I am starting to use the django.contrib.staticfiles application to collect static files in the / static / directory of my project.
The problem is that when I use the django development server (manage.py runningerver), it automatically serves static files.
This is usually normal, but in my case I would like to serve these static files myself.
I would like to add something like this to the urls.py file:
urlpatterns += patterns('', url('^static/(?P<path>.*)$', myStaticMediaServe,{'document_root': settings.STATIC_ROOT ,'show_indexes': True}), )
The problem is that the django.contrib.staticfiles application takes priority on url / static / 'when settings.DEBUG = True: I cannot find a way to force Django to use my' / static / 'urlpattern description while in debug mode
If I remove 'django.contrib.staticfiles' from settings.py: my '/ static /' urlpattern works, but I lose the collection of static files.
You have an idea to use 'django.contrib.staticfiles' And use my own server of static files through urlpattern description And have settings. DEBUG = True
source share