ImportError: cannot import name generic
Closed this issue · 3 comments
spekzz commented
Using Django 1.9.2
I have django.contrib.contenttypes installed
INSTALLED_APPS = [ ... 'django.contrib.contenttypes', ... ]
I still get a error, here is the trace stack.
Traceback (most recent call last):
File "manage.py", line 10, in <module> execute_from_command_line(sys.argv)
File "/home/john/.virtualenvs/tradex/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utility.execute()
File "/home/john/.virtualenvs/tradex/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 327, in execute django.setup()
File "/home/john/.virtualenvs/tradex/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS)
File "/home/john/.virtualenvs/tradex/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models(all_models)
File "/home/john/.virtualenvs/tradex/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models elf.models_module = import_module(models_module_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module import__(name)
File "/home/john/.virtualenvs/tradex/local/lib/python2.7/site-packages/updown/models.py", line 14, in <module> from django.contrib.contenttypes import generic
ImportError: cannot import name generic
dbanck commented
This app hasn't been updated for Django 1.9 yet.
The import must be changed to somthing like from django.contrib.contenttypes.fields import GenericForeignKey
. I might be able to do the changes over the weekend, but a PR for this would be great too :)
dbanck commented
I've released a new version with Django 1.9 support.