0

I have been trying for the last many hours to trace the source of an error

AttributeError: 'Options' object has no attribute 'model_name'

I am getting it while trying to run syncdb or migrations.

My installed apps consist of :

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.comments',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.formtools',
'django.contrib.sitemaps',
'django.contrib.humanize',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
# Uncomment the next line to enable the admin:
'django.contrib.admin',

'customer',
'monitor',
'accounts',
'payments',

'cms',
'mptt',
'menus',
'south',
'sekizai',
'reversion',

'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.link',
'cms.plugins.file',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'cms.plugins.video',

'zinnia',
'tagging',
'cmsplugin_zinnia',

'registration',
'django_filters',
'rest_framework',
'django_countries',
'smartagent',
'captcha',
'django.contrib.markup',
'knowledge',

'djcelery',
'djcelery_email',

'paypal.standard.ipn',
'paypal.standard.pdt',

'raven.contrib.django.raven_compat',
'django_statsd',

)

and requirements file has:

#Requirements for the application
Django>=1.5
Fabric>=1.4.1
South>=0.7.4
psycopg2>=2.4.5
gunicorn>=0.14.1
#newrelic==1.2.0.246
django-celery>=3.0.21
requests
numpy>=1.7.1
raven>=4.0.3
django-statsd-mozilla>=0.3.9


django-mptt>=0.6.0
django-cache-machine==0.6
cssmin==0.1.4
django-cms>=2.4.3
django-blog-zinnia>=0.12.3
cmsplugin_zinnia>=0.4.0

django-reversion<1.8
pil
django-registration>=1.0
djangorestframework
markdown
django-filter
django-countries
django-download-stats>=0.2
django-smartagent>=0.1.1
django-recaptcha>=0.0.6
django-celery-email>=1.0.4
django-knowledge
xlwt>=0.7.5
#django-paypal>=0.1.2

Is there a way of forcing syncdb to show the full stack trace of the error. I tried adding --verbosity 2 but that did not help.

I appreciate your feedback.

4

2 回答 2

1

这张票可能是相关的,特别是:

您在 _meta.model_name 访问时收到此 AttributeError 的原因是该属性仅在 Django 1.6 中引入。恐怕您必须在 Django < 1.6 上访问 _meta.module_name 并将其小写才能获得相同的结果。

我注意到您在 requirements.txt 中指定了 Django 1.5。可能您的第三方应用程序之一是为 Django 1.6+ 而设计的?

于 2014-01-29T16:39:54.977 回答
0

我认为添加 --traceback 到 syncdb 或 migrate 命令应该可以满足您的要求。

于 2014-03-27T19:26:00.950 回答