Have you tried to run manage.py collectstatic ? The devserver with debug serve static file from each app, but it doesn't do it without debug. The idea is that static files should be served directly by your server or with a CDN and not requiring any CPU time from django.
2017-02-11 22:37 GMT+01:00 Rafał eM <r.matyj...@gmail.com>: > Guys, > > Following tutorial from djangoproject.com I stuck with loading CSS to the > site. > > Django 1.10 > > settings.py: > STATIC_URL = '/static/' > > base.html: > <link href="{% static 'css/blog.css' %}" rel="stylesheet" type="text/css"> > > the path to blog.css in my project is: > blog/static/blog/css/blog.css > > it works perfectly fine when running django webserver on my local machine (# > python manage.py runserver), however when putting files on the server it > doesn't work anymore. By opening source of the site I can see: > <link href="/static/blog/css/blog.css" rel="stylesheet" type="text/css"> > > I've found out the workaround - hardcoding the css path to: > <link href="static/css/blog.css" rel="stylesheet" type="text/css"> > > It works, but I'd like to do that in "official" way - using the static tags > - "{% static 'css/blog.css' %}" > > I've tried by changing and/or setting STATIC_URL, STATIC_ROOT, > STATICFILES_DIRS and STATICFILES_FINDERS, but without any success story. > Does any of you have any idea on how to get it working? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/eba57537-c217-49ff-b3e5-ff65796bb8d5%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Cordialement, Coues Ludovic +336 148 743 42 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEuG%2BTY%3Dh5edtMK0n%2BgeOxwCdFXaTV2X_29XK9tdZO6dyM7OLw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.