Return to Snippet

Revision: 54442
at December 24, 2011 03:24 by chrisaiv


Initial Code
import os.path
PROJECT_DIR = os.path.dirname(__file__)


#Here are examples of how you can set your MEDIA_ROOT and TEMPLATE_DIRS
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')

TEMPLATE_DIRS = (
    os.path.join( PROJECT_DIR, 'templates' ),
)

Initial URL


Initial Description
Hate absolute Paths? Me too, I always end up forgetting to change things around when I go into production mode.  Thankfully, there's a nice, clean way to have Python do all the hard work.

Initial Title
Django: Configuring settings.py to rely on relative paths rather than absolute

Initial Tags
django

Initial Language
Django