2👍
✅
Your css file is not rendered by Django template engine and so {{ STATIC_URL }} is not being replaced. You’ll have to use /static/img/IMG_0002.jpg in the CSS file or move that bit of CSS in your html file’s style tag.
-1👍
Try this
settings.py
MEDIA_URL = '/static_media/'
urly.py
if settings.DEBUG:
urlpatterns += patterns('django.views.static',
(r'^static_media/(?P<path>.*)$',
'serve', {
'document_root': '/path/to/static_media',
'show_indexes': True }),)
your css and jquery on template
<link rel="stylesheet" href="{{ MEDIA_URL }}base_min.css" type="text/css" media="screen">
If your are using production version try this
MEDIA_URL = 'http://media.example.org/'
Development: /static_media/base_min.css
Production: http://media.example.org/base_min.css
Hope this will help you
Don’t forget to attached 'django.contrib.staticfiles',
in your INSTALLED_APPS
- [Answer]-Django and custom dependencies
- [Answer]-How to make custom Template for Django Form Wizard properly display validation errors?
- [Answer]-How to save html form in django as i given below
- [Answer]-Django: Custom form __init__() and ReverseMatch errors
- [Answer]-Heroku Django Logging
Source:stackexchange.com