Django 1.6.2 MacOSX 10.9.2 Python 2.7
我最近删除了一个Django应用程序"polls_ChoiceField“,它位于另一个应用程序”轮询“中,因为我只是用它来测试一些东西。然而,自从我删除它之后,它所处的应用程序就不再起作用了。
我通过pyDev包浏览器删除了该文件。当我同步数据库时,它给了我删除陈旧内容的选项,我选择了“是”。
有人能告诉我我要怎么做才能让原来的“民意测验”重新开始吗?
相关终端输出
localhost:src brendan$ python manage.py syncdb
Creating tables ...
The following content types are stale and need to be deleted:
polls | choice_choicefield
polls | poll_choicefield
Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?
If you're unsure, answer 'no'.
Type 'yes' to continue, or 'no' to cancel: yes
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)然后我同步了DB
localhost:src brendan$ python manage.py syncdb
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)我可以运行服务器
localhost:src brendan$ python manage.py runserver
Validating models...
0 errors found当我试图在浏览器中重新访问应用程序时,我得到了
ImportError at /polls/
No module named polls_ChoiceField.urls
Request Method: GET
Request URL: http://localhost:8000/polls/
Django Version: 1.6.2
Exception Type: ImportError
Exception Value:
No module named polls_ChoiceField.urls
Exception Location: /Library/Python/2.7/site-packages/django/utils/importlib.py in import_module, line 40
Python Executable: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Python Version: 2.7.6
Python Path:
['/Users/brendan/Dropbox/workspace/bias_experiment/src',
'/Library/Python/2.7/site-packages/distribute-0.7.3-py2.7.egg',
'/Library/Python/2.7/site-packages/setuptools-2.2-py2.7.egg',
'/Library/Python/2.7/site-packages/pip-1.5.4-py2.7.egg',
'/Library/Python/2.7/site-packages/yolk-0.4.3-py2.7.egg',
'/Library/Python/2.7/site-packages/virtualenv-1.11.4-py2.7.egg',
'/Library/Python/2.7/site-packages/virtualenvwrapper-4.2-py2.7.egg',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages',
'/Library/Python/2.7/site-packages']
Server time: Mon, 28 Apr 2014 16:26:46 +0100谢谢
编辑:使用坏代码行(中间url) My urls.py
urlpatterns = patterns('',
url(r'^polls/', include('polls.urls', namespace="polls")),
url(r'^polls_ChoiceField/', include('polls_ChoiceField.urls', namespace="polls_ChoiceField")),
url(r'^admin/', include(admin.site.urls)),
)再次感谢。
发布于 2014-04-28 15:32:11
查看您的项目级urls.py,看起来它仍然尝试使用删除应用程序中的urls。
https://stackoverflow.com/questions/23345038
复制相似问题