-
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.
added login and registration view function
- Loading branch information
1 parent
487adbc
commit 61fdd43
Showing
10 changed files
with
60 additions
and
40 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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,21 +1,14 @@ | ||
"""Login URL Configuration | ||
"""Login URL Configuration""" | ||
|
||
# Imports Views For Success to Render Content. | ||
from Success import views | ||
from django.urls import include | ||
|
||
The `urlpatterns` list routes URLs to views. For more information please see: | ||
https://docs.djangoproject.com/en/3.1/topics/http/urls/ | ||
Examples: | ||
Function views | ||
1. Add an import: from my_app import views | ||
2. Add a URL to urlpatterns: path('', views.home, name='home') | ||
Class-based views | ||
1. Add an import: from other_app.views import Home | ||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') | ||
Including another URLconf | ||
1. Import the include() function: from django.urls import include, path | ||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | ||
""" | ||
from django.contrib import admin | ||
from django.urls import path | ||
|
||
urlpatterns = [ | ||
path('admin/', admin.site.urls), | ||
# Includes Success url patterns | ||
path('', include('Success.urls')), | ||
] |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,25 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
|
||
|
||
|
||
#...Class User added here... | ||
class Profile(models.Model): | ||
#Attribute Variables for User class to represent different columns in database | ||
''' | ||
-bio-: used to describe user using text | ||
posted by | ||
-profile pic-: saved to profile picture folder created using django model | ||
''' | ||
|
||
user = models.OneToOneField(User,on_delete=models.CASCADE,) | ||
first_name = models.CharField(max_length=30) | ||
last_name = models.CharField(max_length=30) | ||
bio = models.CharField(max_length=350) | ||
|
||
|
||
'''Method to filter database results''' | ||
def __str__(self): | ||
return self.profile.user |
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,10 +1,22 @@ | ||
from django.conf.urls import url,include | ||
from . import views | ||
from Success import views | ||
from django.contrib import admin | ||
from django.urls import include, path | ||
from django.conf.urls.static import static | ||
from django.conf import settings | ||
|
||
urlpatterns = [ | ||
url(r'^$', views.index, name= 'index'), | ||
|
||
|
||
|
||
|
||
################################################################################################################################################################################# | ||
#URL FOR HOME PAGE | ||
################################################################################################################################################################################# | ||
|
||
#HOME Page url! | ||
|
||
#This is the home page url pattern | ||
path(r'', views.index, name= '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,3 +1,32 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. | ||
#---------------------------------------------------------------------# | ||
'''End Of Import''' | ||
#---------------------------------------------------------------------# | ||
|
||
# VIEW FUNCTIONS HERE! | ||
|
||
|
||
|
||
################################################################################################################################################################################# | ||
#HOME PAGE VIEW FUNCTION | ||
################################################################################################################################################################################# | ||
|
||
#Home page view function | ||
def index(request): | ||
title = 'Welcome: This is the Home Page' | ||
context = { | ||
"title": title, | ||
} | ||
return render(request, "Success/index.html",context) | ||
|
||
################################################################################################################################################################################# | ||
#REGISTRATION & LOGIN PAGE VIEW FUNCTION | ||
################################################################################################################################################################################# | ||
|
||
|
||
#Registration & Login page view function | ||
def login(request): | ||
return render(request, 'Registration/login.html') | ||
|
||
################################################################################################################################################################################# |