Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7a858d2199
0
MUOR/MUOR/migrations/__init__.py
Normal file
0
MUOR/MUOR/migrations/__init__.py
Normal file
@ -1,6 +1,4 @@
|
|||||||
from django.contrib.auth.models import User
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.auth.base_user import AbstractBaseUser
|
|
||||||
from django.contrib.auth.models import AbstractUser
|
from django.contrib.auth.models import AbstractUser
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ INSTALLED_APPS = [
|
|||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
'crispy_forms',
|
'crispy_forms',
|
||||||
'MUOR'
|
'MUOR',
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
@ -25,7 +25,9 @@ urlpatterns = [
|
|||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('', include('django.contrib.auth.urls')),
|
path('', include('django.contrib.auth.urls')),
|
||||||
path('signup/', SignUpView.as_view(), name='signup'),
|
path('signup/', SignUpView.as_view(), name='signup'),
|
||||||
path('', TemplateView.as_view(template_name='home.html'), name='home'),
|
path('welcome/', TemplateView.as_view(template_name='home.html'),
|
||||||
path('favicon.ico', RedirectView.as_view(url=staticfiles_storage.url('images/favicon.ico'))),
|
name='home'),
|
||||||
path('test/', views.test, name='test')
|
path('favicon.ico', RedirectView.as_view(
|
||||||
|
url=staticfiles_storage.url('images/favicon.ico'))),
|
||||||
|
path('', views.home, name='home')
|
||||||
]
|
]
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
|
from django.contrib.auth import logout
|
||||||
from django.contrib.auth.forms import UserCreationForm
|
from django.contrib.auth.forms import UserCreationForm
|
||||||
from django.contrib.auth.models import User
|
|
||||||
from django.http import JsonResponse
|
from django.http import JsonResponse
|
||||||
|
from django.shortcuts import redirect
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
from django.views import generic
|
from django.views import generic
|
||||||
|
|
||||||
|
from .models import Profile
|
||||||
|
|
||||||
|
|
||||||
class SignUpForm(UserCreationForm):
|
class SignUpForm(UserCreationForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = Profile
|
||||||
fields = ('username', 'email',)
|
fields = ('username', 'email',)
|
||||||
|
|
||||||
def save(self, commit=True):
|
def save(self, commit=True):
|
||||||
@ -20,5 +23,8 @@ class SignUpView(generic.CreateView):
|
|||||||
template_name = 'registration/signup.html'
|
template_name = 'registration/signup.html'
|
||||||
|
|
||||||
|
|
||||||
def test(request):
|
def home(request):
|
||||||
return JsonResponse(request.COOKIES)
|
if request.user.is_authenticated:
|
||||||
|
logout(request)
|
||||||
|
|
||||||
|
return redirect("/welcome")
|
||||||
|
BIN
MUOR/db.sqlite3
BIN
MUOR/db.sqlite3
Binary file not shown.
Loading…
Reference in New Issue
Block a user