Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to serve with URL prefix #2008

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Sep 19, 2022

  1. Add option to serve with URL prefix

    Added the option to run Doccano with a URL prefix instead of always
    running from the domain root. The prefix is configured by specifying a
    `BASE_URL` environment variable.
    
    To run Doccano under `/doccano/`, set `BASE_URL` to '/doccano/':
    
    ```sh
    export BASE_URL=/doccano/
    ```
    
    When we now compile the front-end, all routes are prefixed with BASE_URL.
    
    We also need to let Django know about our new prefix. This is done using
    the same BASE_URL, but needs to be set during runtime. I could not find
    a clean method to do them both during runtime.
    
    Since such a configuration will most likely only be used in combination
    with a load balancer, I also added the option to set
    `USE_X_FORWARDED_HOST` using environment variables.
    Vinno97 committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    685b98f View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2022

  1. Replace hardcoded URLs by configurable baseURL

    Note that these URLs should probably not be defined in the view anyways.
    I patched them here because I am not familiar enough with the project to
    fix this cleanly.
    Vinno97 committed Sep 20, 2022
    Configuration menu
    Copy the full SHA
    413bb06 View commit details
    Browse the repository at this point in the history