Skip to content

Django migration issues on pscale branch #595

Closed Answered by adrianchang3
adrianchang3 asked this question in Bug Reports
Discussion options

You must be logged in to vote

Solved this after some digging:

Since you cannot apply migrations to an existing schema, fake the migrations first using manage.py migrate --fake. This will bring the dev db up to date with current migrations.

To resolve the site query error, you must create a site object in the sites table for the dev database. This is normally done automatically during initial migration but since that migration wasn't run, you can add a sites object manually in the shell:

manage.py shell
In [1]: from django.contrib.sites.models import Site
In [2]: Site.objects.create(name='127.0.0.1', domain='127.0.0.1')

Make sure you define a site_id in your settings: SITE_ID = 1

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by adrianchang3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant