Reputation: 611
I just delayed my first Django app via Heroku and I'm having an issue that's proving very difficult to resolve. I have django-registration and profiles installed and apparently something runs afoul unless the 'django.contrib.sites', and SITE_ID is removed from settings. Unfortunately, when content is submitted by a user to be displayed, I'm getting the following error:
TemplateSyntaxError at /Caught AttributeError while rendering: 'Settings' object has no attribute 'SITE_ID'.
Only when deleting the user submitted content via the admin does the site reestore.
Adding django.contrib.sites and SITE_ID back just kills the whole app. These issues did not arise during initial development, but only began when the app was deployed. Looking to see if anyone has any insight or advice on how to resolve this.
Upvotes: 1
Views: 2703
Reputation: 8482
What kind of error do you get when you add SITE_ID in the settings file?
This problem usually occurs when there is a discrepancy with data in the table django_site
. Check if your dev and prod database have the same values in that table. Some models may refer to some Django models that use the Site models itself, and unless they cannot find a valid django.contrib.sites.models.site
instance in the database, they will raise an exception. This happens if using the FlatPage models for instance.
Upvotes: 2