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 ec788cd commit d059bb1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions board/api/board/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = f'/{BOARD_SUBPATH}static/'
STATIC_URL = f'{BOARD_SUBPATH}/static/'

STATIC_ROOT = os.path.join(HTDOCS_DIR, 'static') + '/' # noqa: WPS336

MEDIA_URL = f'/{BOARD_SUBPATH}media/'
MEDIA_URL = f'{BOARD_SUBPATH}/media/'

MEDIA_ROOT = os.path.join(HTDOCS_DIR, 'media') + '/' # noqa: WPS336

Expand Down
4 changes: 2 additions & 2 deletions board/api/board/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

urlpatterns = (
[
path(f'{BOARD_SUBPATH}admin/', admin.site.urls),
path(f'{BOARD_SUBPATH}api/v1/', api.urls),
path(f'{BOARD_SUBPATH}/admin/', admin.site.urls),
path(f'{BOARD_SUBPATH}/api/v1/', api.urls),
]
+ static(STATIC_URL, document_root=STATIC_ROOT)
+ static(MEDIA_URL, document_root=MEDIA_ROOT)
Expand Down
4 changes: 2 additions & 2 deletions board/frontend/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@


<Router>
<Route path={`/${global.BOARD_SUBPATH}`}>
<Route path={`${global.BOARD_SUBPATH}/`}>
<Home/>
</Route>
<Route path={`/${global.BOARD_SUBPATH}login`}>
<Route path={`${global.BOARD_SUBPATH}/login`}>
<Login/>
</Route>
</Router>
Expand Down
2 changes: 1 addition & 1 deletion board/frontend/lib/api/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Cookies from "js-cookie";

import { setAuthorized } from "../store";

const loginPath = `/${global.BOARD_SUBPATH}login`;
const loginPath = `${global.BOARD_SUBPATH}/login`;

export const isAuthorized = () => {
return Cookies.get("authorized") ?? false;
Expand Down

0 comments on commit d059bb1

Please sign in to comment.