Switch to JSON web token and set default host to 0.0.0.0

This commit is contained in:
Keannu Bernasol 2023-07-03 23:19:03 +08:00
parent e567b5d399
commit a7d5cdd56e
3 changed files with 5 additions and 2 deletions

View file

@ -3,5 +3,5 @@ from django.urls import path, include
urlpatterns = [ urlpatterns = [
path('', include('djoser.urls')), path('', include('djoser.urls')),
path('', include('djoser.urls.authtoken')), path('', include('djoser.urls.jwt')),
] ]

View file

@ -109,7 +109,7 @@ TEMPLATES = [
REST_FRAMEWORK = { REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': ( 'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication', 'rest_framework_simplejwt.authentication.JWTAuthentication',
) )
} }

View file

@ -2,6 +2,7 @@
"""Django's command-line utility for administrative tasks.""" """Django's command-line utility for administrative tasks."""
import os import os
import sys import sys
from django.core.management.commands.runserver import Command as runserver
def main(): def main():
@ -19,4 +20,6 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
# Override default port for `runserver` command
runserver.default_addr = '0.0.0.0'
main() main()