django startproject - 请求设置LOGGING_CONFIG,但未配置设置

时间:2015-11-09 20:18:58

标签: python django

我正在尝试使用pip install --target /opt/common/external/python_modules正确安装的新位置运行网站包

然后我将PATH设置为指向/opt/common/external/python_modules/django/bin/和我的PYTHONPATH以引用/opt/common/external/python_modules

处的新位置

尝试启动项目时,我会得到以下的Traceback。

[user@server ~]$ 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.

1 个答案:

答案 0 :(得分:0)

我必须在所有软件包上执行pip卸载,并将我的umask设置为022.重新安装django后,它可以正常工作。