Make it possible to (easily) run OpenREM in (IIS) virtual directory

Issue #667 resolved
Luuk created an issue

If you run multiple instances of OpenREM on one server, you might want to host the different instances in virtual directories to easily access the different instances, e.g.: http://server/TST http://server/PRD

To make this easily available it would be handy to have a parameter available in local_settings.py to set this virtual directory.

Comments (29)

  1. Luuk reporter

    Refs #667 Makes it possible to run OpenREM in (IIS) virtual directory.

    Added the option to specify VIRTUAL_DIRECTORY in local_settings.py.example

    Changed openremproject/urls.py to include the option.

    → <<cset 18b519499ae5>>

  2. Luuk reporter

    Refs #667 Makes it possible to run OpenREM in (IIS) virtual directory.

    Added the option to specify VIRTUAL_DIRECTORY in local_settings.py.example Changed openremproject/urls.py to include the option.

    → <<cset 7261d4eba1a2>>

  3. Luuk reporter

    Refs #667

    Changed more templates.

    I wonder if it would be better to use the url reverse lookup option to prevent hard-coded urls in the templates and views.py. Of course you then would have hard-coded names (but you can change the url, without having to change the templates and/or views.py). Actually all the changes for this issue would become obsolete. The only change needed would be in openremproject/urls.py.

    A few items still need to be changed (mainly in the DICOM settings page).

    → <<cset 49328906f33c>>

  4. Ed McDonagh

    I haven't checked - can you use URL reverse lookup in templates? Or would they have to be fed through?

  5. Luuk reporter

    You can use it by using the template tag {% url 'pagename' %}. Actually there are templates in OpenREM that use this.

  6. Luuk reporter

    Refs #667

    Changed all hard-coded urls in templates to reverse url lookup.

    • Script parts have to be done

    • Little testing has been done, but it seems to work fine.

    → <<cset c95ca365bf2d>>

  7. Luuk reporter

    Refs #667

    Replaced static URL in js-files using django-js-reverse. So now all static URLs are replaced by URL-names.

    The use of django-js-reverse implies that for every new release the static reverse.js has to be created by performing: python manage.py collectstatic_js_reverse

    Running on the IIS root everything seems fine (so no degradation). Running in a virtual directory using IIS, the admin user has to login several times and javascript doesn't seem to run nicely.

    → <<cset 54bad041cb21>>

  8. Luuk reporter

    I found the problem for the java part. Django-js-reverse doesn't recognise that the urls are imported indirectly with a leading virtual directory.

  9. Luuk reporter

    Refs Issue #667

    Hopefully removed the strange ascii code 26 in reversie.js just before the end of the file. This seemed to be an issue for codacy to evaluate the file.

    [skip ci]

    → <<cset 6ca7fa228fe4>>

  10. Luuk reporter

    Refs issue #667

    Updated documentation. - Added document for virtual directory settings - Added a link to the document in the installation document.

    → <<cset ea1424a14510>>

  11. Ed McDonagh

    Thanks for adding docs @LuukO - can you change the example virtual directory please - most of the default site runs in a folder called openrem, so that might make people think they need to use this when they don't. Maybe http://server/dms/ or something.

    Thanks again.

  12. Log in to comment