gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
377 stars 273 forks source link

Serve openquake on a different context path #7841

Closed adnanesaghir closed 1 year ago

adnanesaghir commented 2 years ago

Hi, is there a way to serve openquake on a different context path? For example for a custom path mypath we'd like to have:

micheles commented 2 years ago

You have to change the django routes, see https://github.com/gem/oq-engine/blob/master/openquake/server/urls.py

adnanesaghir commented 2 years ago

Thanks for your reply, but it would be great if we have the option as a parameter so we won't compile the code each time

I'd suggest adding a CONTEXT parameter and use it like below

Example for docker: docker run -d --name openquake -p 80:8800 -e CONTEXT=/openquake openquake/engine:latest

micheles commented 2 years ago

We accept pull requests.

adnanesaghir commented 2 years ago

Sorry i'm not a Python developer :) I tried with FORCE_SCRIPT_NAME = "/openquake" in settings.py but it doesn't seem to work I would like to implement the feature in one place without touching all the url paths in urls.py Something like what I'm used to do in Node.js , please see this nodejs sample app

micheles commented 1 year ago

This is implemented in current master as documented here: https://github.com/gem/oq-engine/blob/master/docker/README.md (see the section on WEBUI_PATHPREFIX).