Static files not working in Django
Date : March 29 2020, 07:55 AM
This might help you My static files were absolutely working fine, but yesterday I tried using the app allauth and since then my static files are not being displayed. It is not showing any css or js. I tried commenting the allauth app and even then it does not work. , allauth prescribes using TEMPLATE_CONTEXT_PROCESSORS like this:: TEMPLATE_CONTEXT_PROCESSORS = (
...
"allauth.context_processors.allauth",
"allauth.account.context_processors.account"
)
|
django static files not working
Tag : python , By : lonehunter01
Date : March 29 2020, 07:55 AM
may help you . I don't think you need your static path in urls.py, remove that and it should work. currently it is like this urlpatterns = patterns('',
(r'^$', index),
(r'^ajax/$', ajax),
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': path.join(path.dirname(__file__), 'static')}),
)
urlpatterns = patterns('',
(r'^$', index),
(r'^ajax/$', ajax),
)
|
Cache-Control only working for media files and not static files served using django-pipeline in Django
Date : March 29 2020, 07:55 AM
this will help You are serving static files from django (through django-pipeline) but from web server. Then .htaccess directives have no effect.
|
Django Static js files not working
Date : March 29 2020, 07:55 AM
seems to work fine Well my template code. , Have you changed the settings.py file to include staticroot? STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
{% load static %}
<html>
<head>
<link type="text/css" rel="stylesheet" href="{% static 'css/materialize.min.css' %}">
<link type="text/css" rel="stylesheet" href="{% static 'css/stylesheet.css' %}">
<script type="text/javascript" src="{% static 'js/jquery-1.11.3.min.js' %}"></script>
<title>
- static
-js
- jquery-1.11.3.min.js
-css
- stylesheet.css
- materialize.min.css
- templates
-index.html
|
Static files not working with Django, Heroku, and Django Sass Processor
Tag : django , By : DotNetWise
Date : March 29 2020, 07:55 AM
it helps some times I haven't used this exact set of tools before, but I think you'll have better luck if you approach things this way:
|