有时,我愚蠢、鲁莽和冒险的编程直觉会把我带到一些危险的地方:
我用 sqlite3 启动了一个 Django 1.4 应用程序,然后转移到 mysql,那里没什么大不了的。但后来我意识到我的模型非常适合 NoSql 模型,并决定尝试使用django-nonrel的 MongoDB,它是 Django 1.3 的一个分支,支持非关系数据库。1.4 版还没有准备好使用。
所以,我已经分支了我的 repo,创建了我的 virtualenv 并 pipinstalled django-nonrel 但是当我运行时./manage.py shell
我收到了这条消息
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/marcoslhc/Documents/Proyectos/fontcase/mongoBE/lib/python2.7/site-packages/django/core/management/__init__.py", line 429, in execute_from_command_line
utility.execute()
File "/Users/marcoslhc/Documents/Proyectos/fontcase/mongoBE/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/marcoslhc/Documents/Proyectos/fontcase/mongoBE/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command
app_name = get_commands()[subcommand]
File "/Users/marcoslhc/Documents/Proyectos/fontcase/mongoBE/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands
apps = settings.INSTALLED_APPS
File "/Users/marcoslhc/Documents/Proyectos/fontcase/mongoBE/lib/python2.7/site-packages/django/utils/functional.py", line 276, in __getattr__
self._setup()
File "/Users/marcoslhc/Documents/Proyectos/fontcase/mongoBE/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/Users/marcoslhc/Documents/Proyectos/fontcase/mongoBE/lib/python2.7/site-packages/django/conf/__init__.py", line 139, in __init__
logging_config_func(self.LOGGING)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/config.py", line 776, in dictConfig
dictConfigClass(config).configure()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/config.py", line 562, in configure
'filter %r: %s' % (name, e))
ValueError: Unable to configure filter 'require_debug_false': Cannot resolve 'django.utils.log.RequireDebugFalse': No module named RequireDebugFalse
RequireDebugFalse 是 Django 1.4 中的新功能(请参阅此处和此处),我猜 1.4 中的一些其他底层魔法新功能在这个新安装中也不起作用。我想知道是否可以在不执行django-admin.py startproject
or的情况下将我的应用程序迁移回 Django 1.3 django-admin.py startapp
。