Skip to content

Instantly share code, notes, and snippets.

@kennethlove
Created November 30, 2012 02:07
Show Gist options
  • Save kennethlove/4173327 to your computer and use it in GitHub Desktop.
Save kennethlove/4173327 to your computer and use it in GitHub Desktop.
/ project_dir/
|
+- django/
|
+- assets/
+-- js /
+-- css /
import os
here = lambda * x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
PROJECT_ROOT = here("..", "..")
root = lambda * x: os.path.join(os.path.abspath(PROJECT_ROOT), *x)
[...]
MEDIA_ROOT = root("media")
STATIC_ROOT = root("static")
STATICFILES_DIRS = (
root("assets")
)
MEDIA_URL = "/media/"
STATIC_URL = "/static/"
[...]
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
[...]
urlpatterns += staticfiles_urlpatterns()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment