Skip to content

Commit

Permalink
BOARD_SUBPATH
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Polsky committed Jun 12, 2023
1 parent d059bb1 commit 45deeb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ POSTGRES_PASSWORD=board
VITE_BOARD_API_URL=http://localhost:8000/api/v1
VITE_GITLAB_API_URL=
VITE_GITLAB_API_TOKEN=

BOARD_SUBPATH=""
6 changes: 4 additions & 2 deletions board/api/board/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
from board.apis import api
from board.settings import MEDIA_ROOT, MEDIA_URL, STATIC_ROOT, STATIC_URL, BOARD_SUBPATH

PATH_PREFIX = BOARD_SUBPATH if BOARD_SUBPATH != "" else ""

urlpatterns = (
[
path(f'{BOARD_SUBPATH}/admin/', admin.site.urls),
path(f'{BOARD_SUBPATH}/api/v1/', api.urls),
path(f'{PATH_PREFIX}admin/', admin.site.urls),
path(f'{PATH_PREFIX}api/v1/', api.urls),
]
+ static(STATIC_URL, document_root=STATIC_ROOT)
+ static(MEDIA_URL, document_root=MEDIA_ROOT)
Expand Down

0 comments on commit 45deeb8

Please sign in to comment.