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

Rename PLATFORM_PREFIX -> TECHNICAL_PREFIX and change it's value to more universal one #92

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions {{ cookiecutter.project_slug }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

## API documentation

* ReDoc web UI: [https://{{ cookiecutter.domain_name }}/_platform/docs/v1/redoc/](https://{{ cookiecutter.domain_name }}/_platform/docs/v1/redoc/)
* Swagger web UI: [https://{{ cookiecutter.domain_name }}/_platform/docs/v1/swagger/](https://{{ cookiecutter.domain_name }}/_platform/docs/v1/swagger/)
* Schema YAML: [https://{{ cookiecutter.domain_name }}/_platform/docs/v1/schema/](https://{{ cookiecutter.domain_name }}/_platform/docs/v1/schema/)
* ReDoc web UI: [https://{{ cookiecutter.domain_name }}/_/docs/v1/redoc/](https://{{ cookiecutter.domain_name }}/_/docs/v1/redoc/)
* Swagger web UI: [https://{{ cookiecutter.domain_name }}/_/docs/v1/swagger/](https://{{ cookiecutter.domain_name }}/_/docs/v1/swagger/)
* Schema YAML: [https://{{ cookiecutter.domain_name }}/_/docs/v1/schema/](https://{{ cookiecutter.domain_name }}/_/docs/v1/schema/)

## First run
Application is running in docker containers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from django.urls import include, path


PLATFORM_PREFIX = "_platform"
# All urls that is not intended for regular users should be hidden behind this prefix to ease
# routing configuration and avoid collisions with "useful" urls
TECHNICAL_PREFIX = "_"
API_PREFIX = "api"
DOCS_PREFIX = "docs"

Expand All @@ -24,14 +26,14 @@
from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView

swagger_urlpatterns = [
path(f"{PLATFORM_PREFIX}/{DOCS_PREFIX}/v1/schema/", SpectacularAPIView.as_view(), name="schema"),
path(f"{TECHNICAL_PREFIX}/{DOCS_PREFIX}/v1/schema/", SpectacularAPIView.as_view(), name="schema"),
path(
f"{PLATFORM_PREFIX}/{DOCS_PREFIX}/v1/swagger/",
f"{TECHNICAL_PREFIX}/{DOCS_PREFIX}/v1/swagger/",
SpectacularSwaggerView.as_view(url_name="schema"),
name="v1-schema-swagger-ui",
),
path(
f"{PLATFORM_PREFIX}/{DOCS_PREFIX}/v1/redoc/",
f"{TECHNICAL_PREFIX}/{DOCS_PREFIX}/v1/redoc/",
SpectacularRedocView.as_view(url_name="schema"),
name="v1-schema-redoc",
),
Expand All @@ -54,4 +56,4 @@ class ServerErrorTestView(View):
def dispatch(self, request, *args, **kwargs):
assert False, "Server error test: response with 500 HTTP status code" # noqa: S101

urlpatterns += [path(f"{PLATFORM_PREFIX}/500-error-test/", ServerErrorTestView.as_view())]
urlpatterns += [path(f"{TECHNICAL_PREFIX}/500-error-test/", ServerErrorTestView.as_view())]