Update install documentation for 0.7.0b3 and test

Issue #257 resolved
David Platten created an issue

No description provided.

Comments (27)

  1. David Platten reporter

    Updated install.rst file to cover a fresh install of 0.7.0b3 on Windows using PostgreSQL. Added a new migration file for this fresh install that will add the median function to the PostgreSQL database. Renamed the existing migration file to make it clear that it is to be used when upgrading OpenREM from an earlier version. References issue #257.

    → <<cset 01f2d9d584e4>>

  2. David Platten reporter

    I've successfully followed the instructions to carry out a fresh install of version 0.7.0b3 on Windows using PostgreSQL

  3. Ed McDonagh

    I'm struggling!

    I tried to use your instructions to test out my version with the DICOM QR elements, and it didn't work out well. So I have tried to install the 0.7b3 release. With the following results:

    (test17dj8)mcdonaghe@FRP0218:~/research/test17dj8/lib/python2.7/site-packages/openrem$ python manage.py migrate auth
    Operations to perform:
      Apply all migrations: auth
    Running migrations:
      Rendering model states... DONE
      Applying contenttypes.0001_initial... OK
      Applying contenttypes.0002_remove_content_type_name... OK
      Applying auth.0001_initial... OK
      Applying auth.0002_alter_permission_name_max_length... OK
      Applying auth.0003_alter_user_email_max_length... OK
      Applying auth.0004_alter_user_username_opts... OK
      Applying auth.0005_alter_user_last_login_null... OK
      Applying auth.0006_require_contenttypes_0002... OK
    Traceback (most recent call last):
      File "manage.py", line 10, in <module>
        execute_from_command_line(sys.argv)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
        utility.execute()
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/base.py", line 393, in run_from_argv
        self.execute(*args, **cmd_options)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/base.py", line 444, in execute
        output = self.handle(*args, **options)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 226, in handle
        emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/sql.py", line 280, in emit_post_migrate_signal
        using=db)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 201, in send
        response = receiver(signal=self, sender=sender, **named)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/contrib/sites/management.py", line 20, in create_default_site
        if not Site.objects.using(using).exists():
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/models/query.py", line 586, in exists
        return self.query.has_results(using=self.db)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/models/sql/query.py", line 484, in has_results
        return compiler.has_results()
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 811, in has_results
        return bool(self.execute_sql(SINGLE))
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql
        cursor.execute(sql, params)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
        return self.cursor.execute(sql, params)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
        six.reraise(dj_exc_type, dj_exc_value, traceback)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
        return self.cursor.execute(sql, params)
    django.db.utils.ProgrammingError: relation "django_site" does not exist
    LINE 1: SELECT (1) AS "a" FROM "django_site" LIMIT 1
                                   ^
    
    (test17dj8)mcdonaghe@FRP0218:~/research/test17dj8/lib/python2.7/site-packages/openrem$ python manage.py migrate
    Operations to perform:
      Synchronize unmigrated apps: pagination, django_filters, staticfiles, messages, remapp, humanize
      Apply all migrations: admin, contenttypes, sites, auth, sessions
    Synchronizing apps without migrations:
      Creating tables...
        Creating table remapp_userprofile
        Creating table remapp_uniqueequipmentnames
        Creating table remapp_sizeupload
        Creating table remapp_exports
        Creating table remapp_contextid
        Creating table remapp_generalstudymoduleattr
        Creating table remapp_projectionxrayradiationdose
        Creating table remapp_accumxraydose
        Creating table remapp_calibration
        Creating table remapp_irradeventxraydata
        Creating table remapp_imageviewmodifier
        Creating table remapp_irradeventxraydetectordata
        Creating table remapp_irradeventxraysourcedata
        Creating table remapp_xraygrid
        Creating table remapp_pulsewidth
        Creating table remapp_kvp
        Creating table remapp_xraytubecurrent
        Creating table remapp_exposure
        Creating table remapp_xrayfilters
        Creating table remapp_irradeventxraymechanicaldata
        Creating table remapp_doserelateddistancemeasurements
        Creating table remapp_accumprojxraydose
        Creating table remapp_accummammographyxraydose
        Creating table remapp_accumcassettebsdprojradiogdose
        Creating table remapp_accumintegratedprojradiogdose
        Creating table remapp_patientmoduleattr
        Creating table remapp_patientstudymoduleattr
        Creating table remapp_generalequipmentmoduleattr
        Creating table remapp_ctradiationdose
        Creating table remapp_sourceofctdoseinformation
        Creating table remapp_ctaccumulateddosedata
        Creating table remapp_ctirradiationeventdata
        Creating table remapp_ctreconstructionalgorithm
        Creating table remapp_ctxraysourceparameters
        Creating table remapp_scanninglength
        Creating table remapp_sizespecificdoseestimation
        Creating table remapp_ctdosecheckdetails
        Creating table remapp_observercontext
        Creating table remapp_deviceparticipant
        Creating table remapp_personparticipant
        Running deferred SQL...
      Installing custom SQL...
    Running migrations:
      Rendering model states... DONE
      Applying admin.0001_initial... OK
      Applying sessions.0001_initial... OK
      Applying sites.0001_initial... OK
    (test17dj8)mcdonaghe@FRP0218:~/research/test17dj8/lib/python2.7/site-packages/openrem$ cp ~/research/bbOpenREM/stuff/0002_add_median_function_and_populate_display_name_table.py.inactive remapp/migrations/
    (test17dj8)mcdonaghe@FRP0218:~/research/test17dj8/lib/python2.7/site-packages/openrem$ ls remapp/migrations/
    0002_add_median_function_and_populate_display_name_table.py.inactive
    (test17dj8)mcdonaghe@FRP0218:~/research/test17dj8/lib/python2.7/site-packages/openrem$ mv remapp/migrations/0002_add_median_function_and_populate_display_name_table.py{.inactive,}
    (test17dj8)mcdonaghe@FRP0218:~/research/test17dj8/lib/python2.7/site-packages/openrem$ python manage.py makemigrations --empty remapp
    Migrations for 'remapp':
      0001_initial.py:
    (test17dj8)mcdonaghe@FRP0218:~/research/test17dj8/lib/python2.7/site-packages/openrem$ python manage.py migrate
    Operations to perform:
      Synchronize unmigrated apps: staticfiles, pagination, django_filters, messages, humanize
      Apply all migrations: remapp, sessions, admin, sites, auth, contenttypes
    Synchronizing apps without migrations:
      Creating tables...
        Running deferred SQL...
      Installing custom SQL...
    Running migrations:
      Rendering model states...Traceback (most recent call last):
      File "manage.py", line 10, in <module>
        execute_from_command_line(sys.argv)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
        utility.execute()
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/base.py", line 393, in run_from_argv
        self.execute(*args, **cmd_options)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/base.py", line 444, in execute
        output = self.handle(*args, **options)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 222, in handle
        executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 104, in migrate
        state = migration.mutate_state(state, preserve=do_run)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/migrations/migration.py", line 83, in mutate_state
        operation.state_forwards(self.app_label, new_state)
      File "/home/mcdonaghe/research/test17dj8/local/lib/python2.7/site-packages/django/db/migrations/operations/fields.py", line 50, in state_forwards
        state.models[app_label, self.model_name_lower].fields.append((self.name, field))
    KeyError: ('remapp', u'generalstudymoduleattr')
    

    As you can see, the initial migrate auth has the error you refer to. But the following migrate doesn't offer to create a supersuser. And the migrate after renaming the 0002 file has the error above.

    This is all on Linux, in a virtualenv. Any ideas?

  4. Ed McDonagh

    After creating a superuser, deactivating the 0002 migration, and running the 0001 initial migration, I can start the server without error or warnings.

    This is all using PostgreSQL by the way.

  5. David Platten reporter

    Changes made to release-0.7.0.rst to reflect how to upgrade from 0.6.0 to 0.7.0b3 on Windows. Need to run through this again to check that all is well. References issue #257

    → <<cset 919a35f04f12>>

  6. Ed McDonagh

    A change to readthedocs last night was preventing the docs building - now fixed. I'm hoping that I'll also be able to add automatic install of my version of pynetdicom...

  7. David Platten reporter

    Updated the upgrade instructions and removed some code from the upgrade migration file. Upgrade from 0.6.0 to 0.7.0b3 now tested and working. References issue #257.

    → <<cset 1b1cf5651d36>>

  8. David Platten reporter

    @edmcdonagh, I tried the manage.py createsuperuser before doing the migrate, but I still got errors about certain relationships not existing. The current install doc has a method that works, but it does include a couple of migrate commands that result in errors that may worry some users. There must be a way of doing this cleanly, but I'm not sure what it is.

  9. David Platten reporter

    Moved chart doc image to the right, and also set it as a figure rather than an image so that I can include a caption. References issue #257

    → <<cset 8e5b2e606d2c>>

  10. Log in to comment