Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table django site doesn't exist

Tags:

django

When I try to install a database into my local I used;

python manage.py syncdb --noinput

However, it gave;

Table 'lodging_zh.django_site' doesn't exist"

It gave the error at Site.objects.get_current() line. Probably it tries to reach the currenct_site on the database. However since database is empty, it gave an error. Do you have any idea about this problem to solve?

like image 781
Mehmet Kagan Kayaalp Avatar asked Nov 30 '25 22:11

Mehmet Kagan Kayaalp


1 Answers

Probably something with migration order. You can try to remove django.contrib.sites from the INSTALLED_APPS and then syncdb. If that succeeds add django.contrib.sites and migrate again.

Alternatively you can add 'sites': 'my_app.sites_migrations to MIGRATION_MODULES and then make migrations for this with python manage.py makemigrations sites. Then running syncdb might work as well.

like image 143
Lucas Moeskops Avatar answered Dec 03 '25 15:12

Lucas Moeskops



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!