2015-11-09 97 views
0

我試圖運行從安裝了新的位置上正確使用站點包pip install --target /opt/common/external/python_modulesDjango的startproject命令 - 要求設置LOGGING_CONFIG,但沒有配置設置

然後我把我的路徑指向/opt/common/external/python_modules/django/bin/,我的PYTHONPATH以引用新位置/opt/common/external/python_modules

當試圖啓動一個項目時,我得到下面的Traceback。

[[email protected] ~]$ django-admin.py startproject itam_api 
Traceback (most recent call last): 
    File "/opt/common/external/python_modules/django/bin/django-admin.py", line 5, in <module> 
    management.execute_from_command_line() 
    File "/opt/common/external/python_modules/django/core/management/__init__.py", line 354, in execute_from_command_line 
    utility.execute() 
    File "/opt/common/external/python_modules/django/core/management/__init__.py", line 328, in execute 
    django.setup() 
    File "/opt/common/external/python_modules/django/__init__.py", line 17, in setup 
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) 
    File "/opt/common/external/python_modules/django/django/conf/__init__.py", line 48, in __getattr__ 
    self._setup(name) 
    File "/opt/common/external/python_modules/django/django/conf/__init__.py", line 42, in _setup 
    % (desc, ENVIRONMENT_VARIABLE)) 
django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. 

回答

0

我必須做的所有包畫中畫卸載,並設置我的umask爲022。我重新安裝的Django之後,它工作正常。

相關問題