Skip to content

Instantly share code, notes, and snippets.

@xlevus
Created October 29, 2010 11:27
Show Gist options
  • Save xlevus/653367 to your computer and use it in GitHub Desktop.
Save xlevus/653367 to your computer and use it in GitHub Desktop.
Relative settings for django.
import os
# project/
# code/
# django/ -> ../dist/django/django
# project/
# html/
# templates/
# media/
# admin/ -> ../../dist/django/django/contrib/admin/media
# dist/
# django/
PROJECT_DIR = os.path.realpath(os.path.curdir+"/../..")
MEDIA_ROOT = PROJECT_DIR + "/html/media"
MEDIA_URL = "/media/"
ADMIN_MEDIA_PREFIX = MEDIA_URL + "admin/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment