updating my code
This commit is contained in:
parent
f18d36e42d
commit
c2f1899e20
3 changed files with 23 additions and 1 deletions
15
back/backend/serializers.py
Normal file
15
back/backend/serializers.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
from rest_framework import serializers
|
||||||
|
from . import models
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class BackendSerializer(serializers.ModelSerializer):
|
||||||
|
class Meta:
|
||||||
|
fields = (
|
||||||
|
'id',
|
||||||
|
'title',
|
||||||
|
'description',
|
||||||
|
)
|
||||||
|
# model = models.Backend
|
||||||
|
|
|
@ -39,8 +39,15 @@ INSTALLED_APPS = [
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'backend',
|
'backend',
|
||||||
|
'rest_framework',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
REST_FRAMEWORK = {
|
||||||
|
'DEFAULT_PERMISSION_CLASSES': [
|
||||||
|
'rest_framework.permissions.AllowAny',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
|
|
|
@ -23,5 +23,5 @@ from django.urls import path, include
|
||||||
# add urls to this array
|
# add urls to this array
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('', include("backend.urls")),
|
path('backend/v1/', include("backend.urls")),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue