Django 타사 확장 South 사용 지침

1604 단어 djangosouth
Setting up a brand new project and no database
  • create your database
  • add south to installed apps
  • run syncdb, this will add the django and south tables to the database
  • add your apps
  • for each app run python manage.py schemamigration app_name --initial this will create the initial migration files for your app
  • then run south migrate python manage.py migrate app_name this will add the tables to the database.

  • Setting up a legacy project and database
  • add south to installed apps
  • run syncdb, this will add the south tables to the database
  • for each of your apps run python manage.py schemamigration app_name --initial This will create your initial migrations
  • for each of your apps run python manage.py migrate app_name 0001 --fake , this will fake out south, it won't do anything to the database for those models, it will just add records to the south_migrationhistory table so that the next time you want to create a migration, you are all set.

  • Setting up a legacy project and no database
  • create database
  • add south to installed apps
  • for each of your apps run python manage.py schemamigration app_name --initial This will create your initial migrations
  • run syncdb, this will add any apps that don't have migrations to the database.
  • then run south migrate python manage.py migrate this will run all migrations for your apps.
  • 좋은 웹페이지 즐겨찾기