Skip to content

Instantly share code, notes, and snippets.

@ergusto
Last active December 19, 2015 18:39
Show Gist options
  • Save ergusto/6000407 to your computer and use it in GitHub Desktop.
Save ergusto/6000407 to your computer and use it in GitHub Desktop.
Paths for Django settings files
import django
import os
DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
'''
Example usage:
STATIC_ROOT = os.path.join(SITE_ROOT, 'static'),
...
TEMPLATE_DIRS = (
os.path.join(SITE_ROOT, 'templates'),
)
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment