Why not work with static files in Django?

I looked at the django documentation on connecting the static files and they work part time here is an example

It's in my css is written:
a.navbar-logo{
 font-family: 'RUSNeverwinter';
 src: url('fonts/RUSNeverwinter.ttf');
 font-size: 28pt;
}

a.nav_two{
 font-family: 'RUSNeverwinter';
 src: url('fonts/RUSNeverwinter.ttf');
 font-size: 22pt;
}

It displays the followingXstUP.png

setting:
TEMPLATE_DIR = os.path.join(BASE_DIR, "templates")

 TEMPLATES = [
{
 'BACKEND': 'django.template.backends.django.DjangoTemplates',
 'DIRS': [TEMPLATE_DIR,],
 'APP_DIRS': True,
 'OPTIONS': {
 'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
...
 STATIC_URL = '/static/'
 STATIC_ROOT = os.path.join(BASE_DIR, 'static')

 MEDIA_URL = '/photologue/'
 MEDIA_ROOT = os.path.join(BASE_DIR, 'photologue')

 STATICFILES_DIRS =(

 os.path.join(BASE_DIR, 'static_in_dev'), 
 )

template base.html
<!DOCTYPE html>
{% load static %}
<html lang="EN">
the <head>
 <meta charset="UTF-8">
 <link rel="stylesheet" type="text/css" href="{% static 'css/styles.css' %}"> 
the <body>
 {% block content %}{% endblock %}
</body>
</html>

urls:
if settings.DEBUG:
mapping includes += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
mapping includes += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Django version 2.2
Python version 3.8
April 7th 20 at 15:22
1 answer
April 7th 20 at 15:24
I looked at the django documentation on connecting static files

Probably watched attentively.

url('fonts/RUSNeverwinter.ttf');

Where your fonts folder is located?
Can still
url('/static/fonts/RUSNeverwinter.ttf');
@Benedict47, the css file can not find - Eve commented on April 7th 20 at 15:39
<link rel="stylesheet" type="text/css" href="{% static 'css/styles.css" %}">

This command mounts the css
src: url('fonts/RUSNeverwinter.ttf');
It is right because the css file Is located in one of directry where the folder with fonts - Eve commented on April 7th 20 at 15:27
Secondly I have not beaten the part of the css
Here's the code
a.navbar-logo{
 font-family: 'RUSNeverwinter';
 src: url('fonts/RUSNeverwinter.ttf');
 font-size: 28pt;
}

a.nav_two{
 font-family: 'RUSNeverwinter';
 src: url('fonts/RUSNeverwinter.ttf');
 font-size: 22pt;
}

And it displays the following
5e49fdd3d078d840552875.png - Eve commented on April 7th 20 at 15:30
@Kaylah_Champlthat the browser console displays?

{% static 'css/styles.css" %}

Typo here - sharon.Ziema commented on April 7th 20 at 15:33
@Benedict47a typo I milino when in the Scriptures of the question - Eve commented on April 7th 20 at 15:36
@Kaylah_Champl,

if settings.DEBUG:

Sure debug = True? - sharon.Ziema commented on April 7th 20 at 15:42
@Benedict47set to True (DEBUG = True) - Eve commented on April 7th 20 at 15:45

Find more questions by tags Django