/ Published in: Django
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.
Expand |
Embed | Plain Text
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' ), )
You need to login to post a comment.
