Skip to content

Instantly share code, notes, and snippets.

@tricoder42 tricoder42/urls.py

Created Jun 11, 2013
Embed
What would you like to do?
Snippet to server static and media files in development.
# Append to your urls.py file.
# Development
from django.conf import settings
if settings.DEBUG:
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
media = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns = media + staticfiles_urlpatterns() + urlpatterns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.