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 local_settings.py¶
Django should know in what virtual directory you are running OpenREM. Perform the following steps to do this.
In the OpenREM
local_settings.pyfile, located in the openremproject directory (e.g.
C:\Python27\Lib\site-packages\openrem\oprenremproject\local_settings.py) find the
VIRTUAL_DIRECTORYvariable - if there isn’t one, somewhere in the
VIRTUAL_DIRECTORY=''at the start of a line.
Set this variable to the desired virtual directory
Add under this line the following code to set the
STATIC_URLvariableSTATIC_URL = '/' + os.path.join(VIRTUAL_DIRECTORY, STATIC_URL.lstrip('/'))
In order to make this command work
oshas to be imported, add in
local_settings.pyas third lineimport os
Instead of the above two changes, you can also put a hard-coded STATIC_URL as followsSTATIC_URL = '/VIRTUAL_DIRECTORY/static/'(replace
VIRTUAL_DIRECTORYby 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)
- Open a command prompt and navigate to the openrem directory, e.g.
python manage.py collectstatic_js_reverse
Take care the resulting
reverse.jsis written to the correct static directory. If that is not the case copy the file manually to the correct location.