Skip to content

Instantly share code, notes, and snippets.

@ajamaica
Created October 2, 2012 17:58
Show Gist options
  • Save ajamaica/3821743 to your computer and use it in GitHub Desktop.
Save ajamaica/3821743 to your computer and use it in GitHub Desktop.
settings.py:
MEDIA_ROOT = 'C:/Server/Projects/project_name/static/'
MEDIA_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/media/'
urls.py:
from django.conf import settings
...
if settings.DEBUG:
urlpatterns += patterns('',
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
)
template:
<link rel="stylesheet" type="text/css" href="/static/css/style.css" />
"C:/Server/Projects/project_name/static/css/style.css"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment