When I migrate my django application then in "Postgres" database "django_site" table is not created. Please help me to solve this problem. Thank you.
-
please provide more details about your question.Darshan– Darshan2017-02-14 06:13:22 +00:00Commented Feb 14, 2017 at 6:13
-
I am migrating my django application. I use postgres database. When I use migrate command django creates some table automatically. It includes django_sessions,django_admin_log etc. django_site table should be created but this table is not created after migrating. Other tables are created properly.Prafulla– Prafulla2017-02-14 06:28:26 +00:00Commented Feb 14, 2017 at 6:28
-
by default django doesn't provide it's site framework. so to get django_site table created please refer this link docs.djangoproject.com/en/1.10/ref/contrib/sitesDarshan– Darshan2017-02-14 06:31:48 +00:00Commented Feb 14, 2017 at 6:31
Add a comment
|
1 Answer
Enabling the sites framework
To enable the sites framework, follow these steps:
Add 'django.contrib.sites' to your INSTALLED_APPS setting.
Define a SITE_ID setting:
SITE_ID = 1
Run migrate. your sites table will be created now.
source : https://docs.djangoproject.com/en/1.10/ref/contrib/sites/
Hope this helps.