M
M
ma3xak2018-03-09 19:05:42
Django
ma3xak, 2018-03-09 19:05:42

Djnago doesn't see static files?

In general, the problem was not solved, but what I noticed is strange, Django is trying to get these files in the wrong way.
for example

STATIC_URL = '/home/slon/env_slon/static/'
STATIC_ROOT = os.path.join(BASE_DIR, '/home/slon/env_slon/static/')

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, '/home/slon/env_slon/static/'),
)


**nginx

 location /static {
        root /home/slon/env_slon/static/;
  try_files $uri =404;
        expires max;
    }

And after restarting the server, Django tries to find them:
/home/slon/static/
I don’t know what to do anymore

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Pugachev, 2018-03-09
@Stqs

is it

/home/elephant/
coincides with
/home/myproject/static/

M
ma3xak, 2018-03-11
@ma3xak

In general, everything was decided by editing the paths, but now for some reason the statistics are not immediately given. but it's not so scary anymore

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question