Skip to content

Instantly share code, notes, and snippets.

@simonw
Created May 25, 2009 20:31
Show Gist options
  • Save simonw/117732 to your computer and use it in GitHub Desktop.
Save simonw/117732 to your computer and use it in GitHub Desktop.
# In settings.py:
import os
OUR_ROOT = os.path.realpath(os.path.dirname(__file__))
# In urls.py:
from django.conf import settings
import os
urlpatterns = patterns('',
# ...
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {
'document_root': os.path.join(settings.OUR_ROOT, 'static')
}),
# ...
)
# Then create static/ in the root folder, next to urls.py and settings.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment