Skip to content

Alexeino/Django-Token-Authentication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django-Token-Authentication

Demonstration of Token Authentication API & it's consumption

Registeration Model Serializer

Registeration View

Settings.py

Rest Framework

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': [
        # 'rest_framework.authentication.BasicAuthentication',
        # 'rest_framework.authentication.SessionAuthentication',
        'rest_framework.authentication.TokenAuthentication',  # <-- And here
   ]
}

Installed Apps

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'accounts',
    
    # Third Party
    'rest_framework',           #REST API
    'rest_framework.authtoken',  # <-- Here
]

About

Demonstration of Token Authentication API & it's consumption

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors