Sign up to create your own snipts, or login.

Public snipts » Fotinakis's snipts » Dynamic directories in Django settings.py

posted on Jun 29, 2009 at 5:51 p.m. EDT in 
  • # In settings.py
    PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
    ROOT_DIR = os.path.split(PROJECT_DIR)[0]
    
    
    MEDIA_ROOT = ROOT_DIR + '/static/'
    MEDIA_URL = '/static/'
    
    TEMPLATE_DIRS = (
    	# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    	# Always use forward slashes, even on Windows.
    	# Don't forget to use absolute paths, not relative paths.
    	PROJECT_DIR + '/templates/',
    )
    

    copy | embed

0 Comments

Sign up, or login to leave a comment.