Migrating Models
Go to admin.py, add code
from django.contrib import admin
from mptt.admin import MPTTModelAdmin
from .models import Company
@admin.register(Company)
class CompanyAdmin(MPTTModelAdmin):
pass
@admin.register(HotSearch)
class HotSearchAdmin(admin.ModelAdmin):
passActivate grantmatch-app virtual server
$ workon grantmatch-appMake migrations and migrating
$ python manage.py makemigrations
$ python manage.py migrateRollback migration
Delete individual migration files (both of them)
Update model
New make migration
When make migrations work but not migrate
make migrations work but not migrateLast updated
Was this helpful?