pennersr / django-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://allauth.org
MIT License
9.51k stars 3.03k forks source link

Migrate error - Django 1.7 and 1.8 #613

Closed vinaychandra closed 10 years ago

vinaychandra commented 10 years ago

Error report when trying to run ./manage.py migrate

Using django-dev version 1.8.dev20140509044810

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/vinaychandra/django-trunk/django/core/management/__init__.py", line 427, in execute_from_command_line
    utility.execute()
  File "/home/vinaychandra/django-trunk/django/core/management/__init__.py", line 391, in execute
    django.setup()
  File "/home/vinaychandra/django-trunk/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/vinaychandra/django-trunk/django/apps/registry.py", line 112, in populate
    app_config.ready()
  File "/home/vinaychandra/django-trunk/django/contrib/admin/apps.py", line 22, in ready
    self.module.autodiscover()
  File "/home/vinaychandra/django-trunk/django/contrib/admin/__init__.py", line 23, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/home/vinaychandra/django-trunk/django/utils/module_loading.py", line 74, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/dist-packages/allauth/socialaccount/admin.py", line 12, in <module>
    class SocialAppForm(forms.ModelForm):
  File "/home/vinaychandra/django-trunk/django/forms/models.py", line 270, in __new__
    "needs updating." % name
django.core.exceptions.ImproperlyConfigured: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is prohibited; form SocialAppForm needs updating.

When tried in Django 1.7b3, ./manage.py migrate gives,

/usr/local/lib/python2.7/dist-packages/allauth/socialaccount/admin.py:12: RemovedInDjango18Warning: Creating a ModelForm without either the 'fields' attribute or the 'exclude' attribute is deprecated - form SocialAppForm needs updating
  class SocialAppForm(forms.ModelForm):

CommandError: System check identified some issues:

ERRORS:
socialaccount.SocialApp.sites: (fields.E300) Field defines a relation with model 'Site', which is either not installed, or is abstract.

The problem is already addressed here https://github.com/pennersr/django-allauth/pull/588. Please update the version or provide instructions for installing from the git repo

pennersr commented 10 years ago

588 is released as part of 0.17.0

mikhuang commented 10 years ago

The same error message shows for 1.7 when 'django.contrib.staticfiles' is not in INSTALLED_APPS

eezis commented 10 years ago

The error appears when using Django 1.7 & django-allauth v 0.18.0 (regarding the preceding message, the error occurs even when django.contrib.staticfiles' is in INSTALLED_APPS).

FIX the error by adding 'django.contrib.sites' to INSTALLED_APPS, then adding the allauth apps . . .

'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
donholloway commented 10 years ago

I had this problem. I missed the django.contrib.sites. Thanks eezis.

sheeshmohsin commented 9 years ago

Thanks for this answer, I also had this problem.

jairnet commented 9 years ago

Gracias, solo fue añadir 'django.contrib.sites', y pude hacer la migración con: python manga.py migrate para que funcionara la app django-allauth

olivrg commented 8 years ago

I had the same issue and by simply adding: 'django.contrib.sites', to the installed_apps resolved it.