Commit 62d10782 authored by Quentin VERMANDE's avatar Quentin VERMANDE
Browse files

init auth

parent 97746495
No related merge requests found
Showing with 34 additions and 0 deletions
+34 -0
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")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment