我在Django上啓動了一個項目並將其保存到Github。這是一個虛擬世界。然後我將它從Github下載到另一個virtualenv中,滿足了要求。當我嘗試Django + Mezzanine + Github無法運行項目
(virutalenv)Machine:project user$ python manage.py runserver
[snip snip]
Validating models...
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x10ad7cad0>>
Traceback (most recent call last):
[snip snip]
File "/Users/user/project/lib/python2.7/site-packages/south/db/__init__.py", line 83, in <module>
db = dbs[DEFAULT_DB_ALIAS]
KeyError: 'default'
而當我嘗試在python中加載設置時,會發生以下情況。這些設置位於項目根目錄下的文件settings.py
中。
virtualenv)Machine:project user$ python
Python 2.7.5 (default, May 19 2013, 13:26:46)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>> from django.conf import settings as d_settings
>>> import settings as my_settings
>>> d_settings.configure(my_settings, DEBUG=True)
[snip snip]
File "/Users/user/project/lib/python2.7/site-packages/django/conf/__init__.py", line 186, in __getattr__
return getattr(self.default_settings, name)
AttributeError: 'module' object has no attribute 'LOGGING_CONFIG'
>>> import mezzanine.conf
Traceback (most recent call last):
[snip snip]
File "/Users/user/project/lib/python2.7/site-packages/django/conf/__init__.py", line 186, in __getattr__
return getattr(self.default_settings, name)
AttributeError: 'module' object has no attribute 'DATABASE_ROUTERS'
>>>
此pastebin中的整個未切割轉錄本:http://pastebin.com/C8Cy6e6v。
該項目運行良好的原始virtualenv。它抱怨ALLOWED_HOSTS
沒有設置,但這從來沒有打擾過它。原始數據庫設置是空白的,但這並不妨礙它。我認爲開發數據庫設置在Mezzanine的某個位置,但我不確定它在哪裏。夾層是用所謂的dev.db
項目根目錄下有sqlite3的數據庫,但是,再一次,在已設置了,我無法弄清楚。強制第二個virtualenv上的數據庫設置從相同數據庫文件的副本讀取不起作用。
我認爲它只是加載正確的設置的問題,但我不知道他們在哪裏或在哪裏可以找到他們。