最近我将我的项目升级到最新的Django(从1.8升级到1.11.4),我的模型不再出现在Django Admin界面中了。奇怪的是应用程序本身按预期工作。
完整路径 / myvenv / myproject / apps / myapp /
结构的一部分:
/myvenv/
/bin
/etc
/myproject
/templates
/settings/settings.py
/apps
/myapp
/templates/myapp/myview.html
/views.py
其他一些症状:
nb:'myproject'实际上被称为'项目'(冲突?)
从 / myvenv / myproject / apps / myapp / __ init __强制导入时.py /
from .admin import *
它在第一个admin.site.register()上打破:
LookupError at /admin/
No installed app with label 'myapp'.
我已经:
已安装的应用程序(从manage shell中看到):
<module 'django.contrib.auth' from '/srvapp/local/lib/python2.7/site-packages/django/contrib/auth/__init__.pyc'>
<module 'django.contrib.contenttypes' from '/srvapp/local/lib/python2.7/site-packages/django/contrib/contenttypes/__init__.pyc'>
<module 'django.contrib.sessions' from '/srvapp/local/lib/python2.7/site-packages/django/contrib/sessions/__init__.pyc'>
<module 'django.contrib.messages' from '/srvapp/local/lib/python2.7/site-packages/django/contrib/messages/__init__.pyc'>
<module 'django.contrib.staticfiles' from '/srvapp/local/lib/python2.7/site-packages/django/contrib/staticfiles/__init__.pyc'>
<module 'django.contrib.sites' from '/srvapp/local/lib/python2.7/site-packages/django/contrib/sites/__init__.pyc'>
<module 'bootstrap3' from '/srvapp/local/lib/python2.7/site-packages/bootstrap3/__init__.pyc'>
<module 'django.contrib.admin' from '/srvapp/local/lib/python2.7/site-packages/django/contrib/admin/__init__.pyc'>
<module 'django.contrib.admindocs' from '/srvapp/local/lib/python2.7/site-packages/django/contrib/admindocs/__init__.pyc'>
<module 'myapp' from '/srvapp/project/apps/myapp/__init__.pyc'>
init的:
/myvenv/myproject# find . -name __init__.py
./__init__.py
./apps/__init__.py
./apps/myapp/tests/__init__.py
./apps/myapp/__init__.py
./apps/myapp/migrations/__init__.py
./apps/myapp/templatetags/__init__.py
./apps/myapp/management/__init__.py
./apps/myapp/management/commands/__init__.py
./settings/__init__.py
我正在跑步:
我完全迷失了。