From c2f1899e20d417e861023f7ff36f3b49ec844524 Mon Sep 17 00:00:00 2001 From: Rupika Date: Tue, 22 Jan 2019 23:11:41 -0800 Subject: [PATCH] updating my code --- back/backend/serializers.py | 15 +++++++++++++++ back/reimbursinator/settings.py | 7 +++++++ back/reimbursinator/urls.py | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 back/backend/serializers.py diff --git a/back/backend/serializers.py b/back/backend/serializers.py new file mode 100644 index 0000000..abe24ee --- /dev/null +++ b/back/backend/serializers.py @@ -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 + diff --git a/back/reimbursinator/settings.py b/back/reimbursinator/settings.py index f17a05c..e127de1 100644 --- a/back/reimbursinator/settings.py +++ b/back/reimbursinator/settings.py @@ -39,8 +39,15 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', 'backend', + 'rest_framework', ] +REST_FRAMEWORK = { + 'DEFAULT_PERMISSION_CLASSES': [ + 'rest_framework.permissions.AllowAny', + ] +} + MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', diff --git a/back/reimbursinator/urls.py b/back/reimbursinator/urls.py index 5782995..6ca7cb2 100644 --- a/back/reimbursinator/urls.py +++ b/back/reimbursinator/urls.py @@ -23,5 +23,5 @@ from django.urls import path, include # add urls to this array urlpatterns = [ path('admin/', admin.site.urls), - path('', include("backend.urls")), + path('backend/v1/', include("backend.urls")), ]