Kenya Delivers is a web application platform for Kenyan Government websites.
We are a safe space for Kenyan citizens to access their government services online, tenders and keep track of their politicians's performance to enable better voting .
We're building the web platform using Python's Django web framework.
- Fredrick Adhing'a
- Samuel Mwangi
Runing migrations
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency account.0001_initial on database 'default'.
This happened after addition of a custom User model, per the recommendation in the django docs.
-
Delete the database db.sqlite3
-
Delete the app/migrations folder
-
temporarily comment out
django.contrib.admin.
INSTALLED_APPS = [ ... #‘django.contrib.admin’, ... ]
Also comment out the admin site in urls.py:
urlpatterns = [ path('profile/', include('restapp.urls')), #path('admin/', admin.site.urls), ]
-
Now go ahead and run:
py manage.py makemigrations
then
py manage.py migrate
-
Now U can uncomment all of the above
django.db.utils.OperationalError: no such table: service_user
Who cares....
run
py manage.py migrate --run-syncdb
After commit do the following:
- create a new branch (temporary) -
git branch temporary_branch
- checkout of the current branch you're working on -
git checkout master
- merge the temporary branch -
git merge temporary_branch