Home  >  Q&A  >  body text

python - django数据库初始化

django使用makemigrations和migrate之后数据存在哪里?(我是说这个项目本身怎么记录了你是否同步过数据,我删了数据库和migration下面的文件)如何做能使该文件恢复之前的状态,就是和直接创建项目而没有使用migrate时一样?

阿神阿神2717 days ago331

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 17:17:32

    This may be useful:

    http://stackoverflow.com/questions/29253399/how-to-reset-migrations-in-django-1-7

    reply
    0
  • PHPz

    PHPz2017-04-17 17:17:32

    The relevant data configuration is in settings.py. Please refer to: https://docs.djangoproject.com/en/1.9/ref/settings/

    makemigrations are sql statements that generate databases.

    migrate to execute those statements. Please refer to: https://docs.djangoproject.com/en/1.9/topics/migrations/

    To view specific changes, just check in the database.

    Hope to adopt

    reply
    0
  • Cancelreply