Django

Code

Changeset 793

Show
Ignore:
Timestamp:
10/06/05 12:22:23 (3 years ago)
Author:
adrian
Message:

Fixed #357 -- Added a '--pythonpath' option to django-admin. Thanks for the patch, Hugo

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/bin/django-admin.py

    r692 r793  
    5454    parser.add_option('--settings', 
    5555        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.') 
     56    parser.add_option('--pythonpath', 
     57        help='Lets you manually add a directory the Python path, e.g. "/home/djangoprojects/myproject".') 
    5658    options, args = parser.parse_args() 
    5759 
     
    5961    if options.settings: 
    6062        os.environ['DJANGO_SETTINGS_MODULE'] = options.settings 
     63    if options.pythonpath: 
     64        sys.path.insert(0, options.pythonpath) 
    6165 
    6266    # Run the appropriate action. Unfortunately, optparse can't handle 
  • django/trunk/docs/django-admin.txt

    r692 r793  
    194194``django-admin.py`` will use the DJANGO_SETTINGS_MODULE environment variable. 
    195195 
     196--pythonpath 
     197============ 
     198 
     199Example usage:: 
     200 
     201    django-admin.py init --pythonpath='/home/djangoprojects/myproject' 
     202 
     203Adds the given filesystem path to the Python path. If this isn't provided, 
     204``django-admin.py`` will use the ``PYTHONPATH`` environment variable. 
     205 
    196206--help 
    197207======