Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added complete authentication #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Pipfile
Expand Up @@ -7,10 +7,10 @@ name = "pypi"
coverage = "*"

[packages]

django = "*"
djangorestframework = "*"

django-rest-auth = "*"
django-allauth = "*"

[requires]
python_version = "3.6"
python_version = "3.6"
200 changes: 131 additions & 69 deletions Pipfile.lock

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

2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -28,7 +28,7 @@ Django REST framework / React quickstart

## TODO

* Authentication
* ~~Authentication~~
* React routing
* Production

Expand Down
21 changes: 21 additions & 0 deletions project/project/settings.py
Expand Up @@ -38,6 +38,12 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_framework.authtoken',
'rest_auth',
'django.contrib.sites',
'allauth',
'allauth.account',
'rest_auth.registration',
'leads',
'frontend'
]
Expand Down Expand Up @@ -121,3 +127,18 @@
# https://docs.djangoproject.com/en/2.0/howto/static-files/

STATIC_URL = '/static/'


REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication',
'rest_framework.authentication.TokenAuthentication',
],
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
]
}

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

SITE_ID = 1
4 changes: 3 additions & 1 deletion project/project/urls.py
@@ -1,6 +1,8 @@
from django.urls import path, include

urlpatterns = [
path('api/auth/', include('rest_auth.urls')),
path('api/auth/register/', include('rest_auth.registration.urls')),
path('', include('leads.urls')),
path('', include('frontend.urls')),
]
]