-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
136406e
commit 724c506
Showing
63 changed files
with
461 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class AccountsConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'accounts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.contrib.auth.forms import UserCreationForm | ||
from django.contrib.auth.models import User | ||
from django import forms | ||
|
||
|
||
class SignUpForm(UserCreationForm): | ||
class Meta: | ||
model = User | ||
fields = ('username', 'first_name', | ||
'last_name', 'email', | ||
'password1', 'password2',) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from django.urls import path | ||
from django.contrib.auth import views | ||
|
||
from accounts.views import SignUpView | ||
|
||
urlpatterns = [ | ||
path('login/', views.LoginView.as_view(), name='login'), | ||
path('logout/', views.LogoutView.as_view(), name='logout'), | ||
path('signup/', SignUpView.as_view(), name='signup') | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django.contrib.auth.views import LoginView | ||
from django.http import HttpResponseRedirect | ||
from django.shortcuts import render | ||
from django.urls import reverse | ||
from django import views | ||
|
||
from accounts.forms import SignUpForm | ||
|
||
|
||
class SignUpView(views.View): | ||
|
||
def get(self, request): | ||
form = SignUpForm() | ||
context = { | ||
'form': form | ||
} | ||
return render(request, 'registration/signup.html', context) | ||
|
||
def post(self, request): | ||
form = SignUpForm(request.POST) | ||
if form.is_valid(): | ||
form.save() | ||
return HttpResponseRedirect(reverse('index')) | ||
context = { | ||
'form': form | ||
} | ||
return render(request, 'registration/signup.html', context) | ||
|
||
# class CustomLoginView(LoginView): | ||
# pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
myclub_website/courses/migrations/0010_alter_quizquestions_question.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.0.3 on 2022-05-29 08:47 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('courses', '0009_quiz_quizquestions'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='quizquestions', | ||
name='question', | ||
field=models.TextField(blank=True), | ||
), | ||
] |
22 changes: 22 additions & 0 deletions
22
myclub_website/courses/migrations/0011_remove_courses_category_courses_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 4.0.3 on 2022-05-29 11:35 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('courses', '0010_alter_quizquestions_question'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='courses', | ||
name='category', | ||
), | ||
migrations.AddField( | ||
model_name='courses', | ||
name='category', | ||
field=models.ManyToManyField(to='courses.category'), | ||
), | ||
] |
24 changes: 24 additions & 0 deletions
24
myclub_website/courses/migrations/0012_remove_courses_category_courses_category.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 4.0.3 on 2022-05-29 11:36 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('courses', '0011_remove_courses_category_courses_category'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='courses', | ||
name='category', | ||
), | ||
migrations.AddField( | ||
model_name='courses', | ||
name='category', | ||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='courses.category'), | ||
preserve_default=False, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.