gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
This commit is contained in:
3
routes/__init__.py
Executable file
3
routes/__init__.py
Executable file
@@ -0,0 +1,3 @@
|
||||
from . import local, production, common
|
||||
|
||||
urlpatterns = local.urlpatterns + production.urlpatterns + common.urlpatterns
|
||||
56
routes/common.py
Executable file
56
routes/common.py
Executable file
@@ -0,0 +1,56 @@
|
||||
"""
|
||||
All urls configurations tree
|
||||
"""
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.http import HttpResponse
|
||||
from django.urls import include, path, re_path
|
||||
from django.views.static import serve
|
||||
|
||||
from routes.swagger import schema_view
|
||||
|
||||
|
||||
def health(request):
|
||||
return HttpResponse("OK: #e300e79ae3e5dbce142672f917cc1ff664810d8c")
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path("health/", health),
|
||||
path("admin/", admin.site.urls),
|
||||
path("rosetta/", include("rosetta.urls")),
|
||||
path("accounts/", include("django.contrib.auth.urls")),
|
||||
path(
|
||||
"ckeditor5/",
|
||||
include("django_ckeditor_5.urls"),
|
||||
name="ck_editor_5_upload_file",
|
||||
), # noqa
|
||||
path("i18n/", include("django.conf.urls.i18n")),
|
||||
# Internal apps
|
||||
path("api/", include("core.apps.accounts.urls")),
|
||||
path("", include("core.apps.home.urls")),
|
||||
path("api/", include("core.apps.eggs.urls")),
|
||||
# Media and static files
|
||||
re_path(
|
||||
r"static/(?P<path>.*)", serve, {"document_root": settings.STATIC_ROOT}
|
||||
), # noqa
|
||||
re_path(
|
||||
r"media/(?P<path>.*)", serve, {"document_root": settings.MEDIA_ROOT}
|
||||
), # noqa
|
||||
# Swagger urls
|
||||
path(
|
||||
"swagger<format>/",
|
||||
schema_view.without_ui(cache_timeout=120),
|
||||
name="schema-json",
|
||||
), # noqa
|
||||
path(
|
||||
"swagger/",
|
||||
schema_view.with_ui("swagger", cache_timeout=120),
|
||||
name="schema-swagger-ui",
|
||||
), # noqa
|
||||
path(
|
||||
"redoc/",
|
||||
schema_view.with_ui("redoc", cache_timeout=120),
|
||||
name="schema-redoc",
|
||||
), # noqa
|
||||
]
|
||||
10
routes/local.py
Executable file
10
routes/local.py
Executable file
@@ -0,0 +1,10 @@
|
||||
"""
|
||||
Local urls for debugging
|
||||
"""
|
||||
|
||||
from django.urls import path
|
||||
from django.urls import include
|
||||
|
||||
urlpatterns = [
|
||||
path("debug", include("debug_toolbar.urls")),
|
||||
]
|
||||
5
routes/production.py
Normal file
5
routes/production.py
Normal file
@@ -0,0 +1,5 @@
|
||||
"""
|
||||
Production urls
|
||||
"""
|
||||
|
||||
urlpatterns = []
|
||||
20
routes/swagger.py
Executable file
20
routes/swagger.py
Executable file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Swagger urls
|
||||
"""
|
||||
|
||||
from drf_yasg import openapi
|
||||
from rest_framework import permissions
|
||||
from drf_yasg.views import get_schema_view
|
||||
|
||||
schema_view = get_schema_view(
|
||||
openapi.Info(
|
||||
title="Snippets API",
|
||||
default_version="v1",
|
||||
description="Test description",
|
||||
terms_of_service="https://www.google.com/policies/terms/",
|
||||
contact=openapi.Contact(email="JscorpTech@gmail.com"),
|
||||
license=openapi.License(name="BSD License"),
|
||||
),
|
||||
public=True,
|
||||
permission_classes=[permissions.AllowAny],
|
||||
)
|
||||
Reference in New Issue
Block a user