Advertisement
urbanslug

allauth

Jul 27th, 2013
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. Getting the following error when I try to run python manage.py syncdb:
  2. CommandError: One or more models did not validate:
  3. socialaccount.socialapp: 'sites' has an m2m relation with model <class 'django.contrib.sites.models.Site'>, which has either not been installed or is abstract.
  4.  
  5.  
  6. ===============================================================================================
  7. /usr/lib/python2.7/django/contrib/sites/models.py: class Site
  8. _________________________________________________________________________________________
  9.  
  10. @python_2_unicode_compatible
  11. class Site(models.Model):
  12.  
  13. domain = models.CharField(_('domain name'), max_length=100,
  14. validators=[_simple_domain_name_validator])
  15. name = models.CharField(_('display name'), max_length=50)
  16. objects = SiteManager()
  17.  
  18. class Meta:
  19. db_table = 'django_site'
  20. verbose_name = _('site')
  21. verbose_name_plural = _('sites')
  22. ordering = ('domain',)
  23.  
  24. def __str__(self):
  25. return self.domain
  26.  
  27.  
  28. ==============================================================================
  29.  
  30. foo/allauth/socialaccount/models.py class SocialApp
  31. ____________________________________________________________________________
  32.  
  33. @python_2_unicode_compatible
  34. class SocialApp(models.Model):
  35. objects = SocialAppManager()
  36.  
  37. provider = models.CharField(max_length=30,
  38. choices=providers.registry.as_choices())
  39. name = models.CharField(max_length=40)
  40. client_id = models.CharField(max_length=100,
  41. help_text='App ID, or consumer key')
  42. key = models.CharField(max_length=100,
  43. blank=True,
  44. help_text='Key (Stack Exchange only)')
  45. secret = models.CharField(max_length=100,
  46. help_text='API secret, client secret, or'
  47. ' consumer secret')
  48. # Most apps can be used across multiple domains, therefore we use
  49. # a ManyToManyField. Note that Facebook requires an app per domain
  50. # (unless the domains share a common base name).
  51. # blank=True allows for disabling apps without removing them
  52. sites = models.ManyToManyField(Site, blank=True)
  53.  
  54. def __str__(self):
  55. return self.name
  56.  
  57.  
  58. ================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement