Hello,

While it's not easy to know exactly what the problem is in your case without
more information (such as the web server's configuration), a general
understanding of Django's static files in production can help, and to this end
I've made a schematic that you may find useful, at
https://djangodeployment.com/2016/11/21/how-django-static-files-work-in-production/.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 02/12/2017 12:40 AM, Rafał eM wrote:
> Guys,
>
> I'm following one of the Django tutorials but currently stuck with a problem.
> When running django webserver on my local machine everything works fine, but
> when upload the project to the server it doesn't read css file anymore.
>
> settings.ps:
> |
> STATIC_URL ='/static/'
> |
>
> base.html:
> |
> {%load static%}...<link href="{% static 'blog/css/blog.css'
> %}"rel="stylesheet"type="text/css">
> |
>
> The path to the file is:
> |
> blog/static/blog/css/blog.css
> |
>
> Regardles of configuration I use, I always see in the source:
> |
> <linkhref="/static/blog/css/blog.css
> <http://willhelm.usermd.net/static/blog/css/blog.css>"rel="stylesheet"type="text/css">
>
>
> |
>
> I've tried with other STATIC constants from django documentation, but none of
> them really worked.
>
> However, if I hardcode the css, everything works fine again:
> |
> <linkhref="static/css/blog.css"rel="stylesheet"type="text/css">
> |
>
> Does any of you have any idea on how to solve the issue?
>
> -- 
> 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
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto: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/124bc2cb-75c7-4077-a7ed-f7465202ae98%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/124bc2cb-75c7-4077-a7ed-f7465202ae98%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/62c6029a-9188-a29e-a720-b54271241dfb%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to