【发布时间】:2015-04-29 19:10:20
【问题描述】:
我正在使用 Ubuntu 14.04 并尝试安装 Pootle 的 2.7 版,有人告诉我应该使用 Git 而不是 pip,我认为这是因为这个版本不稳定,所以不t 有一个 pip 包/尚未设置为与 pip 一起使用。但是不熟悉 Python(而且我根本不是一个程序员)我在使用 manage.py 初始化数据库时遇到了麻烦。
到目前为止,我已将 master 分支签出到 /srv/www/pootle/project,并使用 pip 将 /usr/local/lib/python2.7/dist-packages/django 中的 Django 升级到 1.7.7 版。 (见Pootle 2.7 requirements。)
我之前使用 pip 和 pootle setup 成功安装了 Pootle 2.5 版来初始化数据库,但是因为 Pootle 2.7 有 removed the pootle setup command,所以我一直在尝试使用 ./manage.py initdb 初始化数据库。结果是:
Traceback (most recent call last):
File "./manage.py", line 20, in <module>
cmd_log(*sys.argv)
File "/srv/www/pootle/project/pootle/core/log.py", line 61, in cmd_log
fn = settings.LOGGING.get('handlers').get('log_action').get('filename')
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 46, in __getattr__
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 115, in __init__
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
我想这是因为正在使用 Django 设置,而不是我在 /srv/www/pootle/pootle.conf 的设置,它有我的密钥和其他配置。
我尝试将--settings=pootle 选项与manage.py 和django-admin.py 一起使用,在/usr/local/lib/python2.7/dist-packages/django/ 和/usr/local/lib/python2.7/dist-packages/django/conf/ 中使用一个名为pootle.settings 的符号链接导致我的pootle.conf,但仍然得到The SECRET_KEY setting must not be empty .
【问题讨论】:
标签: python django python-2.7 pootle