开发者

shell_plus isn't autoloading all the apps it should be

Below I'm showing what happens when I run ./manage.py shell_pus and what my settings.py file looks like.

jason@buster:~/projects/mcifdjango$ ./manage.py shell_plus
From 'auth' autoload: Permission, Group, User, Message
From 'contenttypes' autoload: ContentType
From 'sessions' autoload: Session
From 'sites' autoload: Site
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>
jason@buster:~/projects/mcifdjango$ tail -c387 settings.py

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django_extensions',
    'mcif',
    # Uncomment the next line to enable the admin:
    # 'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)

Here are the relevant parts, isolated. Here's what it's loading:

From 'auth' autoload: Permission, Group, User, Message
From 'contenttypes' autoload: ContentType
From 'sessions' autoload: Session
From 'sites' autoload: Site

And here's what I believe it should be loading:

    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django_extensions',
开发者_运维知识库    'mcif',

As you can see, 'django.contrib.messages', 'django_extensions' and 'mcif' are being left behind. I have no idea what's causing this or how to troubleshoot it. Any advice?


Django_extensions has no models to load, so it's not strange that no model is loaded.

OTOS the Messages model that is being loaded in the 'auth' line is probably the one from contrib.messages. Explore the model class in the shell to verify its app_label.

For what matters your custom 'mcif' app, it probably has no models, or they are incorrectly declared. Anyway a code example could help isolate the problem, if any.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜