Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Getting the following error when I try to run python manage.py syncdb:
- CommandError: One or more models did not validate:
- socialaccount.socialapp: 'sites' has an m2m relation with model <class 'django.contrib.sites.models.Site'>, which has either not been installed or is abstract.
- ===============================================================================================
- /usr/lib/python2.7/django/contrib/sites/models.py: class Site
- _________________________________________________________________________________________
- @python_2_unicode_compatible
- class Site(models.Model):
- domain = models.CharField(_('domain name'), max_length=100,
- validators=[_simple_domain_name_validator])
- name = models.CharField(_('display name'), max_length=50)
- objects = SiteManager()
- class Meta:
- db_table = 'django_site'
- verbose_name = _('site')
- verbose_name_plural = _('sites')
- ordering = ('domain',)
- def __str__(self):
- return self.domain
- ==============================================================================
- foo/allauth/socialaccount/models.py class SocialApp
- ____________________________________________________________________________
- @python_2_unicode_compatible
- class SocialApp(models.Model):
- objects = SocialAppManager()
- provider = models.CharField(max_length=30,
- choices=providers.registry.as_choices())
- name = models.CharField(max_length=40)
- client_id = models.CharField(max_length=100,
- help_text='App ID, or consumer key')
- key = models.CharField(max_length=100,
- blank=True,
- help_text='Key (Stack Exchange only)')
- secret = models.CharField(max_length=100,
- help_text='API secret, client secret, or'
- ' consumer secret')
- # Most apps can be used across multiple domains, therefore we use
- # a ManyToManyField. Note that Facebook requires an app per domain
- # (unless the domains share a common base name).
- # blank=True allows for disabling apps without removing them
- sites = models.ManyToManyField(Site, blank=True)
- def __str__(self):
- return self.name
- ================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement