From 7dce7ad68165b5ecda99ebbf5b9e923a43b7d43d Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 18 Oct 2016 16:46:48 +1300 Subject: [PATCH] README: update setup instructions With Django 1.8 you don't need to use syncdb since migrate does all of the database structure setup (and in fact in 1.9 it has been removed - we don't support that version yet but it's good to avoid that issue in future). The only other thing that syncdb did was to create a superuser, and there is now a specific command to do that. Since you do need to actually log in as part of some of the later steps, we now tell the user explicitly to run that in the first step. Additionally, add a section about what to do when upgrading - normally this is straightforward, but if you're upgrading from prior to the Django 1.8 move then you need to fake the initial migration or it'll fail (since the structure is already present). Signed-off-by: Paul Eggleton --- README | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/README b/README index eb38ced..719164c 100644 --- a/README +++ b/README @@ -46,10 +46,8 @@ Setup instructions: 2. Run the following commands within the layerindex-web directory to initialise the database: - python3 manage.py syncdb python3 manage.py migrate - - You should answer "yes" when asked to create an admin account. + python3 manage.py createsuperuser 3. You can test the web application locally by setting DEBUG = True in settings.py and running the following: @@ -122,6 +120,7 @@ Setup instructions: keeping in mind you'll need to set up Docker properly as part of the setup process. + Usage ----- @@ -134,6 +133,25 @@ and update the database with the results. Run the script with --help for further information on available options. +Upgrading from an earlier version +--------------------------------- + +This application uses Django's migrations functionality to allow changes +in the database structure whilst preserving existing data. When upgrading +with an existing database, you just need to invoke the migration command. + +If you're migrating from a version prior to the Django 1.8 upgrade, you +need to use the following command so that the initial migration (which +takes care of creating the database structure and initial data) is +skipped: + +python3 manage.py migrate --fake-initial + +Otherwise, you can just run the plain migration command: + +python3 manage.py migrate + + Maintenance -----------