Documente Academic
Documente Profesional
Documente Cultură
html
<html>
<link rel= "stylesheet" href= " { % static 'css/style.css '% } " >
</head>
<body>
<nav class= " navbar navbar-expand-lg navbar-dark ftco navbar bg-dark ftco-navbar-light " >
<div class="container">
<div class="overlay"></div>
<div class="container">
<div class="text">
<i class="mr-2"> </i> Login </a> <a href= "sign_up" class= "btn btn-dark px-5 btn-round py-4 mb-2">
<i class=" mr-2"></i> Signup </a> </p> </div> </div> </div> </div>
</section>
</body>
</html>
Sign_up.html
<html lang="en">
<head>
<title>Signup Here</title>
{% load static %}
</head>
<body>
<div class="limiter">
<div class="container-login100">
<span class="focus-input100"></span></div>
<span class="focus-input100"></span></div>
<span class="label-input100">Email</span>
<span class="focus-input100"></span></div>
<span class="label-input100">Password</span>
<span class="focus-input100"></span></div>
<span class="focus-input100"></span></div>
<div class="contact100-form-checkbox">
<div class="container-login100-form-btn">
<div class="wrap-login100-form-btn">
<div class="login100-form-bgbtn"></div>
</form></div></div></div>
</body>
</html>
Login.html
<html lang="en">
<title>Login Here</title>
</head>
<body>
<div class="limiter">
<div class="wrap-login100">
{%csrf_token %}
<span class="login100-form-logo">
<div class="contact100-form-checkbox">
<div class="container-login100-form-btn">
</form><</div></div></div>
</body>
</html>
Book.html
<html >
<title>Book Here</title>
</head>
<span class="form-label">Email</span></div></div>
</div></div></div>
</form>
</body>
</html>
Logged_in.html
<html>
</head>
Click On The Link Below To Check Your Booking History <br> <br>
</html>
Signup.html
<html>
<head>
</head>
<div style= " text – align : center ; font-family:Lucida sans; " >
<strong> Your Data Has Been Successfully Added To Our Server . Please Go To The <a href ="login"
</html>
Forgot.html
<head>
<body>
<h1 style = " color : black ">Sorry Can't Do Anything For Your Mistake</>
<p>GO BACK TO THE <a href="home" style=" color : dodgerblue " > HOME PAGE </a> TO SIGNUP AGAIN BY NEW
CREDENTIALS</p></body>
Log_error.html
<html>
<head>
</head>
<strong> The Data You Entered Didn't Match Any Of Our Records. Please Go Back To The
</strong>
</html>
Email_error.html
<html>
<head>
</head>
<strong> The E-mail You Entered Already Exists . Please Go Back To The
Different E-mail .
</strong>
</html>
Error.html
<html>
<head>
</head>
<strong> The Passwords You Entered Didn't Match . Please Go Back To The
<a href ="sign_up" target="_self"> Signup Page </a> And Re-enter The Details .
</strong>
</html>
Booked.html
<html>
<title>Booking Successful</title>
</head>
<body>
<div class="text">
</section>
</body>
</html>
Urls.py
from django.contrib import admin
urlpatterns = [
path('home', views.home),
path('login',views.login),
path('logged_in', views.logged_in),
path('sign_up',views.sign_up),
path("signup",views.signup),
path("forgot",views.forgot),
path("book/",views.book),
path("book/booked",views.booked)
Settings.py
(Only Changed Parts Shown)
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'login',
]
TEMPLATES = [
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
STATIC_URL = '/static/'
Views.py
mycon=sqltor.connect(host="localhost",user="root",passwd="sql",database="hotel")
cursor=mycon.cursor()
def home(request):
def login(request):
def sign_up(request):
return render(request,"sign_up.html")
def forgot(request):
return render(request,"forgot.html")
def signup(request):
d=request.POST
email=d['email']
cursor.execute(st1)
data=cursor.fetchall()
else:
if d['psw']==d['psw-repeat']:
.format(d['fname'],d['lname'], d['email'],d['phn'],d['psw'])
cursor.execute(st)
mycon.commit()
return render(request,'signup.html')
else:
return render(request,'error.html')
def logged_in(request):
d=request.POST
s="SELECT email,password, phone FROM signup WHERE email LIKE '{}' && password LIKE
'{}'".format(d['uname1'],d['psw1'])
cursor.execute(s)
data=cursor.fetchall()
break
count=cursor.rowcount
if count==1:
cursor.execute(st)
mycon.commit()
return render(request,"logged_in.html")
else:
return render(request,"log_error.html")
def book(request):
return render(request,"book.html")
def booked(request):
d=request.POST
cursor.execute(c)
data=cursor.fetchall()
cid=cursor.rowcount
('{}','{}','{}','{}','{}','{}','{}','{}','{}','{}','{}','{}')".format(d['fname'],d['lname'],d['add'],d['city'],d['zp']\
,d['state'],d['email'],d['phn'],d['rt1'],d['rt2'],d['rt3'],cid)
cursor.execute(s)
mycon.commit()
cursor.execute(s1)
mycon.commit()
cursor.execute(s2)
mycon.commit()
return render(request,'booked.html')
SQL-TABLES