#357 closed enhancement (fixed)
[patch]: django-admin.py needs a --projects parameter
Description ¶
this parameter is to add stuff to the sys.path environment, so people don't need to either use admin rights to link their projects directory to some python path or use the PYTHONPATH environment variable.
Index: bin/django-admin.py =================================================================== --- bin/django-admin.py (revision 535) +++ bin/django-admin.py (working copy) @@ -52,11 +52,15 @@ parser = DjangoOptionParser(get_usage()) parser.add_option('--settings', help='Python path to settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') + parser.add_option('--projects', + help='Python path to projects directory, e.g. where myproject of "myproject.settings.main" resides. If this isn\'t provided, the PYTHONPATH environment variable will be used.') options, args = parser.parse_args() # Take care of options. if options.settings: os.environ['DJANGO_SETTINGS_MODULE'] = options.settings + if options.projects: + sys.path.insert(0, options.projects) # Run the appropriate action. Unfortunately, optparse can't handle # positional arguments, so this has to parse/validate them.
Change History (4)
comment:1 by , 20 years ago
comment:3 by , 20 years ago
Component: | Tools → django-admin.py |
---|
comment:4 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
this ticket references #248*, too