Skip to content

Commit

Permalink
Merge pull request #92 from django-stars/rename-and-change-platform-p…
Browse files Browse the repository at this point in the history
…refix

Rename `PLATFORM_PREFIX` -> `TECHNICAL_PREFIX` and change it's value to more universal one
  • Loading branch information
denys-chura authored Oct 30, 2024
2 parents a8a9769 + e3a5d00 commit 84cd6f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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())]

0 comments on commit 84cd6f3

Please sign in to comment.