Skip to content

Commit

Permalink
config: Add AML_SUBPATH environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Feb 14, 2024
1 parent 5bfe857 commit 78be3d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/podman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
AML_CORS_ORIGIN_WHITELIST: ${{ vars.AML_CORS_ORIGIN_WHITELIST }}
AML_DEBUG: ${{ vars.AML_DEBUG }}
AML_LOCATION_PROVIDER: ${{ vars.AML_LOCATION_PROVIDER }}
AML_SUBPATH: ${{ vars.AML_SUBPATH }}
DJANGO_SETTINGS_MODULE: ${{ vars.DJANGO_SETTINGS_MODULE }}
SQL_DATABASE: ${{ vars.SQL_DATABASE }}
SQL_HOST: ${{ vars.SQL_HOST }}
Expand Down
2 changes: 2 additions & 0 deletions backend/aml/base_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,5 @@
# We recommend adjusting this value in production.
profiles_sample_rate=0.2,
)

SUBPATH = os.getenv('AML_SUBPATH', None)
6 changes: 4 additions & 2 deletions backend/aml/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
# ^ The static helper function only works in debug mode
# (https://docs.djangoproject.com/en/3.0/howto/static-files/)

# Prefix all URLS with /server
urlpatterns = [path('server/', include(urlpatterns))]

# Prefix all URLS with /server if AML_SUBPATH is set
if settings.SUBPATH:
urlpatterns = [path('server/', include(urlpatterns))]

# Debug toolbar
if settings.DEBUG:
Expand Down
1 change: 1 addition & 0 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ services:
- AML_CORS_ORIGIN_WHITELIST=${AML_CORS_ORIGIN_WHITELIST}
- AML_LOCATION_PROVIDER=${AML_LOCATION_PROVIDER}
- AML_SECRET_KEY=${AML_SECRET_KEY}
- AML_SUBPATH=${AML_SUBPATH}
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE}
- DJANGO_SUPERUSER_USERNAME=${DJANGO_SUPERUSER_USERNAME}
- DJANGO_SUPERUSER_EMAIL=${DJANGO_SUPERUSER_EMAIL}
Expand Down

0 comments on commit 78be3d0

Please sign in to comment.