Changeset 5696
- Timestamp:
- 07/14/07 09:47:14 (1 year ago)
- Files:
-
- django/trunk/django/core/management.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/management.py
r5609 r5696 1714 1714 # way. For example, if this file (manage.py) lives in a directory 1715 1715 # "myproject", this code would add "/path/to/myproject" to sys.path. 1716 project_directory = os.path.dirname(settings_mod.__file__)1716 project_directory, settings_filename = os.path.split(settings_mod.__file__) 1717 1717 project_name = os.path.basename(project_directory) 1718 settings_name = os.path.splitext(settings_filename)[0] 1718 1719 sys.path.append(os.path.join(project_directory, '..')) 1719 1720 project_module = __import__(project_name, {}, {}, ['']) … … 1721 1722 1722 1723 # Set DJANGO_SETTINGS_MODULE appropriately. 1723 os.environ['DJANGO_SETTINGS_MODULE'] = '%s. settings' % project_name1724 os.environ['DJANGO_SETTINGS_MODULE'] = '%s.%s' % (project_name, settings_name) 1724 1725 return project_directory 1725 1726
