0

我正在安装一个 django 应用程序模块。我收到此错误。我启动了另一个 MicroInstance 并重新安装了所有内容,但仍然出现此错误。.

Environment:


Request Method: GET
Request URL: http://54.235.127.252/mds/

Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
['sana.mrs',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'sana.mrs.util.LoggingMiddleware')


Traceback:
File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  101.                             request.path_info)
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in resolve
  250.             for pattern in self.url_patterns:
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in _get_url_patterns
  279.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/lib/python2.7/dist-packages/django/core/urlresolvers.py" in _get_urlconf_module
  274.             self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/opt/sana/urls.py" in <module>
  12. admin.autodiscover()
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/__init__.py" in autodiscover
  26.             import_module('%s.admin' % app)
File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py" in import_module
  35.     __import__(name)
File "/opt/sana/mrs/admin.py" in <module>
  26. admin.site.register(ClientEventLog, ClientEventLogAdmin)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/sites.py" in register
  97.             validate(admin_class, model)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/validation.py" in validate
  24.     validate_base(cls, model)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/validation.py" in validate_base
  279.             check_formfield(cls, model, opts, 'exclude', field)
File "/usr/lib/python2.7/dist-packages/django/contrib/admin/validation.py" in check_formfield
  369.                 "is missing from the form." % (cls.__name__, label, field))

Exception Type: ImproperlyConfigured at /
Exception Value: 'ClientEventLogAdmin.exclude' refers to field 'created' that is missing from the form.

注意:我只需要安装这个应用程序。我是python的中级。和Django的初学者。但是专业的PHP,mysql和jQuery前端

4

1 回答 1

0

在我看来,问题很可能与moca框架有关。

如果您的/opt/sana/mrs/admin.py文件看起来像这样,那么罪魁祸首可能位于第 12 行:该created字段在排除列表中被引用,但之前未定义。

由于我不确定您的需求,这里有一些您可以尝试的解决方案:

  • 重新安装或更新您的moca框架词;
  • 在执行定义之前添加一段代码(虽然不确定它应该是什么类型):

    from django.db import models # You may also place it in the top of the file
    created = models.DateField(blank=True, null=True)
    
  • 从列表中删除created项目exclude(虽然不确定影响)

希望能帮助到你,

于 2013-02-07T13:51:52.893 回答