Skip to content
Snippets Groups Projects
Commit 62d10782 authored by Quentin VERMANDE's avatar Quentin VERMANDE
Browse files

init auth

parent 97746495
No related branches found
No related tags found
No related merge requests found
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class AccountsConfig(AppConfig):
name = 'accounts'
from django.db import models
# Create your models here.
from django.test import TestCase
# Create your tests here.
from django.urls import include, path
import django.contrib.auth.views as dj_auth_views
from .views import login, logout
app_name = "accounts"
accounts_patterns = [
path("login/", dj_auth_views.LoginView.as_view(), name="login"),
path("logout/", logout, name="logout"),
]
urlpatterns = [
path("", include(accounts_patterns)),
]
from django.shortcuts import render, redirect
@login_required
def logout(req):
auth_logout(req)
return redirect("home:home")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment