defaults in genereated settings.py are absolute paths for template directories, media directories and media urls
|Reported by:||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||1.1|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
'best practice' seems to be to use
import os OUR_ROOT = os.path.realpath( os.path.dirname(__file__) ) MEDIA_ROOT = os.path.join(OUR_ROOT, 'media') MEDIA_URL = '/media/' 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. os.path.join(OUR_ROOT, 'templates') )
Shouldn't the automatically generated settings.py file include these things right from the beginning ?
It can take a newbie like me a long time to figure out all these little details required to make a project relocatable.