Question

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.

Was it helpful?

Solution

This ticket might be relevant, specifically:

The reason you're getting this AttributeError upon _meta.model_name access is that property was only introduced in Django 1.6. I'm afraid you'll have to access _meta.module_name and lower case it on Django < 1.6 to get the same result.

I notice you're specifying Django 1.5 in your requirements.txt. Possibly one of your third party apps is designed to work with Django 1.6+?

OTHER TIPS

I think adding --traceback to the syncdb or migrate command should do what you asked for.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top