I put them in a folder called static , which is in the top-level folder of the web project.
Example:
/ static / IMG /
/ Static / JS /
/ Static / CSS /
/ Templates / Network urls.py
settings.py
In my urls.py file, I have the following rule:
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
My settings.py contains:
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'static').replace('\\', '/') ADMIN_MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'static/admin').replace('\\', '/')
source share