-
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
32b15a1
commit e524d69
Showing
32 changed files
with
596 additions
and
282 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
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 |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from django.contrib.auth.views import LogoutView | ||
from django.urls import path | ||
|
||
from .views import * | ||
from django.contrib.auth.views import LogoutView | ||
|
||
urlpatterns = [ | ||
path('login/', Login.as_view(), name='login'), | ||
path('logout/', LogoutView.as_view(next_page='login'), name='logout'), | ||
] | ||
path("login/", Login.as_view(), name="login"), | ||
path("logout/", LogoutView.as_view(next_page="login"), name="logout"), | ||
] |
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
from django.shortcuts import render | ||
from django.contrib.auth.views import LoginView, LogoutView | ||
from django.shortcuts import render | ||
from django.urls import reverse_lazy | ||
|
||
|
||
# Create your views here. | ||
class Login(LoginView): | ||
template_name = 'registration/login.html' | ||
fields = '__all__' | ||
template_name = "registration/login.html" | ||
fields = "__all__" | ||
redirect_authenticated_user = True | ||
|
||
def get_success_url(self): | ||
return reverse_lazy('index') | ||
|
||
return reverse_lazy("index") |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
from django.contrib import admin | ||
|
||
from .models import Movies | ||
|
||
# Register your models here. | ||
admin.site.register(Movies) | ||
admin.site.register(Movies) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,24 @@ | ||
from django import forms | ||
from django import forms | ||
|
||
from .models import Movies | ||
|
||
|
||
class MovieForm(forms.ModelForm): | ||
class Meta: | ||
model = Movies | ||
fields = ['title', 'length_in_minutes', 'released_at', 'country_of_origin', 'summary', 'youtube_trailer_id'] | ||
fields = [ | ||
"title", | ||
"length_in_minutes", | ||
"released_at", | ||
"country_of_origin", | ||
"summary", | ||
"youtube_trailer_id", | ||
] | ||
widgets = { | ||
'title': forms.TextInput(attrs={'class': 'form-control'}), | ||
'length_in_minutes': forms.TextInput(attrs={'class': 'form-control'}), | ||
'released_at': forms.TextInput(attrs={'class': 'form-control'}), | ||
'country_of_origin': forms.TextInput(attrs={'class': 'form-control'}), | ||
'summary': forms.Textarea(attrs={'class': 'form-control'}), | ||
'youtube_trailer_id': forms.TextInput(attrs={'class': 'form-control'}), | ||
} | ||
"title": forms.TextInput(attrs={"class": "form-control"}), | ||
"length_in_minutes": forms.TextInput(attrs={"class": "form-control"}), | ||
"released_at": forms.TextInput(attrs={"class": "form-control"}), | ||
"country_of_origin": forms.TextInput(attrs={"class": "form-control"}), | ||
"summary": forms.Textarea(attrs={"class": "form-control"}), | ||
"youtube_trailer_id": forms.TextInput(attrs={"class": "form-control"}), | ||
} |
Oops, something went wrong.