From d2d86d437fc161dab2b2fe45290be78d5c85867f Mon Sep 17 00:00:00 2001 From: vicky deka Date: Sat, 12 Dec 2020 22:54:04 +0530 Subject: [PATCH 1/2] login using rest-auth --- requirements.txt | Bin 804 -> 890 bytes simplifyreport/settings.py | 8 ++++++++ simplifyreport/urls.py | 3 +++ 3 files changed, 11 insertions(+) diff --git a/requirements.txt b/requirements.txt index 67b80ff4ea7aba85296f7225c57d2a801d0e9a48..50fb254d622df74d5c483af7268d36a2d941a10b 100644 GIT binary patch delta 82 zcmZ3&_KR(U45OfqnOc)G-q`_uxMoA_Bvo#LB delta 12 TcmeyxwuEhi4CCe^Mh+$b9!dkK diff --git a/simplifyreport/settings.py b/simplifyreport/settings.py index df1fd8a..35d484c 100644 --- a/simplifyreport/settings.py +++ b/simplifyreport/settings.py @@ -41,8 +41,16 @@ 'rest_framework', 'core', 'fcm_django', + 'rest_framework.authtoken', + 'rest_auth', + 'django.contrib.sites', + 'allauth', + 'allauth.account', + 'rest_auth.registration', ] +SITE_ID = 1 + FCM_DJANGO_SETTINGS = { "FCM_SERVER_KEY": "AAAAqhzg_1I:APA91bFic77g3QIUsTmIM-kFhOHJ-Qev60Yw7kuxgiZmDlsrpgVptISStXnHWJVIwE3Fo49IJxd5bXMXjoFIqYLgJQxLCGrnrUHsoasDAiXsf8FtC9JZsq-EQcV2bp6Ti-S3kSspR0R0" } diff --git a/simplifyreport/urls.py b/simplifyreport/urls.py index dc00e8b..c7809d0 100644 --- a/simplifyreport/urls.py +++ b/simplifyreport/urls.py @@ -21,6 +21,9 @@ urlpatterns = [ path('admin/', admin.site.urls), path('',include('core.urls')), + path('api-auth/', include('rest_framework.urls')), + path('rest-auth/', include('rest_auth.urls')), + path('rest-auth/registration/', include('rest_auth.registration.urls')), ] if settings.DEBUG: From 518e1c204f353fb516f744fc384991eab373ca2e Mon Sep 17 00:00:00 2001 From: vicky deka Date: Sat, 12 Dec 2020 23:10:47 +0530 Subject: [PATCH 2/2] url for login --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index dccb11e..1a4bfa3 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,10 @@ This repository contains the REST APIs of the application. ``` https://simplify-reports.herokuapp.com/profile/ ``` +- For User Login +``` +http://127.0.0.1:8000/rest-auth/login/ +``` - Making fire reports - GET and POST request ``` https://simplify-reports.herokuapp.com/fire/