문제

Was on a Linux machine, working on a Django website. Recently got a new computer and am running windows 8 on it. I am using PyCharm, and am trying to start the local server up for the first time. The last dependency I installed was zinnia, and now it is giving me this odd error. This is the output that PyCharm is giving me before not working.

Unhandled exception in thread started by <bound method Command.inner_run of       
<django.contrib.staticfiles.management.commands.runserver.Command object at 0x029643F0>>
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py",     
line 92, in inner_run
self.validate(display_num_errors=True)
File "C:\Python27\lib\site-packages\django\core\management\base.py", line 280, in 
validate
num_errors = get_validation_errors(s, app)
File "C:\Python27\lib\site-packages\django\core\management\validation.py", line 35, in 
get_validation_errors
for (app_name, error) in get_app_errors().items():
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 166, in 
get_app_errors
self._populate()
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 72, in _populate
self.load_app(app_name, True)
File "C:\Python27\lib\site-packages\django\db\models\loading.py", line 96, in load_app
models = import_module('.models', app_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in  
import_module
__import__(name)
File "C:\Python27\lib\site-packages\django_blog_zinnia-0.12.3-py2.7.egg\zinnia\models
\__init__.py", line 2, in <module>
from zinnia.models.entry import Entry
File "C:\Python27\lib\site-packages\django_blog_zinnia-0.12.3-py2.7.egg\zinnia\models
\entry.py", line 23, in <module>
from zinnia.models.author import Author

File "C:\Python27\lib\site-packages\django_blog_zinnia-0.12.3-py2.7.egg\zinnia\models
\author.py", line 10, in <module>
class Author(User):
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 123, in __new__
raise TypeError("%s cannot proxy the swapped model '%s'." % (name, base_meta.swapped))
TypeError: Author cannot proxy the swapped model 'main.MyUser'.

올바른 솔루션이 없습니다

다른 팁

Although the error suggests that you are using the newest version of zinnia (12.3) it seem that's not the case. If you look at the models/authors.py file of the current version you will see:

class Author(get_user_model()):
    """
    Proxy model around :class:`django.contrib.auth.models.get_user_model`.
    """

which will deal with Django 1.5's custom user model. The traceback you supplied has the following:

class Author(User):

which is the old approach. Have a look here for more information:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top