Skip to content

Commit 8012769

Browse files
committedDec 23, 2023
change debug mode to true
1 parent 43a4c9b commit 8012769

36 files changed

+8018
-12
lines changed
 

‎oppsproject/settings.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
SECRET_KEY = 'django-insecure-1oegd2uu(-+ytj^t3&*_ub*u@xu-nse2v8jfjv@so$j^@vg*5i'
1616

1717
# SECURITY WARNING: don't run with debug turned on in production!
18-
DEBUG = False
18+
DEBUG = True
1919

2020
ALLOWED_HOSTS = ['*']
2121

@@ -35,6 +35,7 @@
3535
'allauth',
3636
'allauth.account',
3737
'allauth.socialaccount',
38+
'drf_yasg',
3839

3940
'rest_framework_swagger',
4041

@@ -89,7 +90,16 @@
8990

9091
WSGI_APPLICATION = 'oppsproject.wsgi.application'
9192

92-
93+
SWAGGER_SETTINGS = {
94+
'USE_SESSION_AUTH': False,
95+
'SECURITY_DEFINITIONS': {
96+
'Token': {
97+
'type': 'apiKey',
98+
'name': 'Authorization',
99+
'in': 'header',
100+
},
101+
},
102+
}
93103
# Database
94104
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
95105

‎oppsproject/urls.py

+20-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
21
from django.contrib import admin
3-
from django.urls import path,include
4-
from rest_framework_swagger.views import get_swagger_view
5-
2+
from django.urls import path, include
3+
from drf_yasg.views import get_schema_view
4+
from django.conf import settings
5+
from django.conf.urls.static import static
6+
from drf_yasg import openapi
7+
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
68

7-
schema_view = get_swagger_view(title='OOPS API Documentation')
9+
schema_view = get_schema_view(
10+
openapi.Info(
11+
title="OOPS API Documentation",
12+
default_version='v1',
13+
),
14+
)
815

916
urlpatterns = [
1017
path('admin/', admin.site.urls),
11-
path('api/v1/account/',include('dj_rest_auth.urls')),
12-
path('api/v1/account/register/',include('dj_rest_auth.registration.urls')),
13-
path('api/v1/docs/',schema_view),
14-
path('api/v1/proposal/',include('proposals.urls'))
15-
]
18+
path('api/v1/account/', include('dj_rest_auth.urls')),
19+
path('api/v1/account/register/', include('dj_rest_auth.registration.urls')),
20+
path('api/v1/docs/', schema_view.with_ui('swagger', cache_timeout=0),
21+
name='schema-swagger-ui'),
22+
path('api/v1/proposal/', include('proposals.urls')),
23+
]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
24+
25+
urlpatterns += staticfiles_urlpatterns()

‎static/drf-yasg/README

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Information about external resources
2+
3+
The following files are taken from external resources or trees.
4+
5+
Files: insQ.js
6+
insQ.min.js
7+
License: MIT
8+
Copyright: Zbyszek Tenerowicz
9+
Eryk Napierała <eryk.piast@gmail.com>
10+
Askar Yusupov <devex.soft@gmail.com>
11+
Dan Dascalescu <ddascalescu+github@gmail.com>
12+
Source: https://github.com/naugtur/insertionQuery v1.0.3
13+
14+
Files: immutable.js
15+
immutable.min.js
16+
License: MIT
17+
Copyright: 2014-present, Facebook, Inc
18+
Source: https://github.com/immutable-js/immutable-js/releases/tag/v3.8.2

0 commit comments

Comments
 (0)
Please sign in to comment.