Running the OpenREM website in a virtual directory

If you want to run the OpenREM in a virtual directory (like http://server/dms/) you need to configure this in your web server application that you are using (IIS or nginx). Next to that you also need to configure this in OpenREM. The following steps are necessary:

  • Configure virtual directory in
  • Update the

Configure virtual directory in

Django should know in what virtual directory you are running OpenREM. Perform the following steps to do this.

  • In the Openrem file, located in the openremproject directory (e.g. C:\Python27\Lib\site-packages\openrem\oprenremproject\ find the VIRTUAL_DIRECTORY variable

  • Set this variable to the desired virtual directory

  • Add under this line the following code to set the STATIC_URL variable

    STATIC_URL = '/' + os.path.join(VIRTUAL_DIRECTORY, STATIC_URL.lstrip('/'))
  • In order to make this command work os has to be imported, add in as third line

    import os
  • Instead of the above two changes, you can also put a hard-coded STATIC_URL as follows

(replace VIRTUAL_DIRECTORY by the actual value):


  • Take care the virtual directory name ends with a slash (/)
  • Take care the virtual directory name is exactly the same as configured in the web server (this is case-sensitive)

Update the

The static file should be updated in order to change the URLs in the static javascript files also.


The current version of django-js-reverse (v0.8.2) has an ommission. To prevent a wrong update, you have to edit the file of this package.

  • Browse to the file, e.g. C:\Python27\Lib\site-packages\django_js_reverse\management\commands

  • Open the file in an editor

  • line 40 (“default_urlresolver = get_resolver(None)”) should be replaced with the following lines (correct indentation is important in Python; the “try:” should start with 8 leading spaces)

    urlconf = getattr(settings, 'ROOT_URLCONF', None)
    default_urlresolver = get_resolver(urlconf)
  • Save the file

After updating the file, perform the following 2 steps:
  • Open a command prompt and navigate to the openrem directory, e.g. C:\Python27\Lib\site-packages\openrem
  • Type python collectstatic_js_reverse


Take care the resulting is written to the correct static directory. If that is not the case copy the file manually to the correct location.