Skip to content

Commit

Permalink
Merge pull request #14 from SmartWasteSegregatorAndRoutePlanner/creat…
Browse files Browse the repository at this point in the history
…e-auth-endpoint

chore: implement auth endpoint
  • Loading branch information
dmdhrumilmistry committed Feb 3, 2023
2 parents 45349c1 + 53b0847 commit f1809a2
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 2 deletions.
10 changes: 9 additions & 1 deletion backend_api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'route_planner.apps.RoutePlannerConfig',
'dj_rest_auth'
]

MIDDLEWARE = [
Expand Down Expand Up @@ -135,8 +137,14 @@
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES': [
# 'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
]
],
'DEFAULT_AUTHENTICATION_CLASSES': (
'dj_rest_auth.jwt_auth.JWTCookieAuthentication',
)
}
REST_USE_JWT = True
JWT_AUTH_COOKIE = 'X-JWT-AUTH-COOKIE'
JWT_AUTH_REFRESH_COOKIE = 'X-JWT-AUTH-REFRESH-COOKIE'

# to store routes
ROUTES_DATA_FILE_PATH = path_join(BASE_DIR, 'cache', 'routes.json')
1 change: 1 addition & 0 deletions backend_api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
urlpatterns = [
path('admin/', admin.site.urls),
path('api/route-planner/', include('route_planner.urls')),
path('api/auth/', include('dj_rest_auth.urls'))
]

admin.site.site_header = "Smart Waste Segregation and Route Planner Admin Page"
Expand Down
63 changes: 62 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ folium = "^0.14.0"
python-dotenv = "^0.21.0"
osmnx = "^1.3.0"
scikit-learn = "^1.2.1"
dj-rest-auth = "^2.2.7"
djangorestframework-simplejwt = "^5.2.2"


[build-system]
Expand Down

0 comments on commit f1809a2

Please sign in to comment.