Django admin not showing models

后端 未结 6 1647
悲&欢浪女
悲&欢浪女 2021-02-07 09:27

I\'m damned if I can figure out why my models are not showing in the admin.

models.py looks like this:

from django.db import models

class Publication(mo         


        
6条回答
  •  走了就别回头了
    2021-02-07 09:50

    Step 1: Delete all the migrations from migrations folder.

    step 2: Go to root directory and type

    python manage.py makemigrations publications
    

    Note: publications here is your sub-app name

    xrdb # Main directory folder

    ├── xrdb # Main app

    ├── publications # Sub app

    step 3:

    python manage.py sqlmigrate publications 0001
    

    Note : 0001 is migrations file name

    This will solve your problem

    Cheers!!

提交回复
热议问题