Professional Documents
Culture Documents
Source Code - Online Library System
Source Code - Online Library System
BATCH: C
GROUP: A1
Pokharkar Akshay Hanumant Chandrabhaga VU1F1920053
Dhumal Pratik Pramod Smita VU1F1920058
Singh Aman Shashidhar Sangeeta VU1F1920064
Hadawale Hrithik Kashinath Archana VU1F1920059
SOURCE CODE:
/**home**/
//admin.py
admin.site.register(Contact)
admin.site.register(category)
admin.site.register(Library)
admin.site.register(signup)
//apps.py
class HomeConfig(AppConfig):
name = 'home'
//models.py
class category(models.Model):
category = models.CharField(max_length=25)
def __str__(self):
return self.category
class Contact(models.Model):
name = models.CharField(max_length=20)
email = models.CharField(max_length=50)
date = models.DateField()
def __str__(self) :
return self.name
class Library(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class signup(models.Model):
name = models.CharField(max_length=20)
email = models.CharField(max_length=50)
def __str__(self):
return self.name
//urls.py
urlpatterns = [
path('about',views.about, name='about'),
path('Category',views.Category, name='services'),
path('Books',views.Books, name='services'),
path('Contact',views.contact, name='contact'),
path('signup',views.signup, name='signup'),
path('pay',views.pay, name='pay')
//views.py
def index(request):
def about(request):
def Books(request):
lis = Library.objects.all()
def contact(request):
if request.method == "POST":
name = request.POST.get("name")
email = request.POST.get("email")
phone = request.POST.get("phone")
contact.save()
def signup(request):
def pay(request):
/**home**/
/**static**/
//App.js
const form=document.getElementById('form');
const username=document.getElementById('username');
const email=document.getElementById('email');
const password=document.getElementById('password');
const password2=document.getElementById('password2');
function showError(input,message){
const formControl=input.parentElement;
formControl.className='form-control error';
const small=formControl.querySelector('small');
small.innerText=message;
function showSuccess(input){
const formControl=input.parentElement;
formControl.className='form-control success';
function isValidEmail(email)
return re.test(String(email).toLowerCase());
}
form.addEventListener('submit',function(e){
e.preventDefault();
if(username.value===''){
showError(username,'Username is required');
else{
showSuccess(username);
if(email.value===''){
showError(email,'Email is required');
}else if(!isValidEmail(email.value)){
else{
showSuccess(email);
if(password.value===''){
showError(password,'Password is required');
else{
showSuccess(password);
if(password2.value===''){
else{
showSuccess(password2);
}
});
/**static**/
/**Templates**/
//base.html
{% load static %}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--Website icon-->
<style>
*{
box-sizing: border-box;
body{
background-image: url('./static/images/pexels-photo-19077851.jpeg');
background-size: cover;
}
nav{
text-transform: uppercase;
footer{
background-color: black;
color: bisque;
</style>
</head>
<span class="navbar-toggler-icon"></span>
</button>
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
<li class="nav-item">
</li>
</ul>
</form>
</div>
</nav>
<body>
{% if messages %}
{{ message }}
<span aria-hidden="true">×</span>
</button>
</div>
{% endfor %}
{% endif %}
{% block body %} {% endblock body %}
-->
</body>
<div class="row">
<p>Here you can use rows and columns to organize your footer content.</p>
</div>
<h5 class="text-uppercase">Help</h5>
<ul class="list-unstyled">
<li>
</li>
<li>
</li>
<li>
</li>
</ul>
</div>
<h5 class="text-uppercase">Feedback</h5>
<ul class="list-unstyled">
<li>
</li>
<li>
</li>
<li>
</li>
<li>
</li>
</ul>
</div>
</div>
</div>
d = new Date();
document.getElementById("demo").innerHTML = d.getFullYear();
</script> -->
</div>
</footer>
</html>
//books.html
{% extends 'base.html' %}
{% load static %}
{% block body %}
{% for i in lis %}
<div class="row">
<div class="col-md-4">
<div class="card-body">
<h5>{{i.name}}</h5>
<div class="btn-group">
View
</a>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endblock body %}
//category.html
{% extends 'base.html' %}
{% load static %}
{% block body %}
<div class="container">
<div class="col-md-4">
<div class="card-body">
<h5>{{i.name}}</h5>
<h7>Author:{{i.author}}</h7>
<div class="btn-group">
View
</a>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
//contact.html
{% extends 'base.html' %}
{% csrf_token %}
{% block body %}
{% csrf_token %}
<div class="form-group">
<label for="name">name</label>
<div class="valid-tooltip">
Looks good!
</div>
</div>
<div class="form-group">
<div class="invalid-tooltip">
</div>
</div>
<div class="invalid-tooltip">
</div>
</div>
</div>
</form>
</div>
<style>
.container{
color: beige;
</style>
{% endblock body %}
//index.html
{% extends 'base.html' %}
{% block body %}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
rel="stylesheet">
<style>
*{
box-sizing: border-box;
}
body{
background-image: url('./static/images/pexels-photo-19077851.jpeg');
background-size: cover;
h2{
text-transform: uppercase;
color: white;
font-size: 40px;
font-weight: 700;
.heading{
position: absolute;
display: flex;
top: 20%;
left: 50%;
.container1 .intro{
position: absolute;
display: flex;
top: 35%;
left: 50%;
.container1 .intro p{
color: wheat;
font-family: 'Bebas Neue';
font-size: 25px;
</style>
</head>
<body>
<div class="heading">
<h2>Online Library</h2>
</div>
<div class="container1">
<div class="intro">
<p>
Online Library Project is about Providing more free boks to students, Teachers,<br>
People in search of ebooks,etc.
</p>
<style>
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
</style>
</div>
</div>
<hr class="my-4">
<!--Carousel Wrapper-->
<!--Controls-->
<div class="controls-top">
</div>
<!--/.Controls-->
<!--Indicators-->
<ol class="carousel-indicators">
</ol>
<!--/.Indicators-->
<!--Slides-->
<!--First slide-->
<div class="col-md-4">
<div class="card-body">
</div>
</div>
</div>
<div class="card-body">
<h4 class="card-title">Programming</h4>
</div>
</div>
</div>
<div class="card-body">
<h4 class="card-title">Religion</h4>
</div>
</div>
</div>
</div>
</div>
<!--/.First slide-->
<!--Second slide-->
<div class="carousel-item">
<div class="row">
<div class="col-md-4">
<div class="card-body">
<h4 class="card-title">Educational</h4>
</div>
</div>
</div>
<div class="card-body">
<h4 class="card-title">Thriller</h4>
</div>
</div>
</div>
<div class="card-body">
<h4 class="card-title">Medicine</h4>
</div>
</div>
</div>
</div>
</div>
<!--/.Second slide-->
<!--Third slide-->
<div class="carousel-item">
<div class="row">
<div class="col-md-4">
<div class="card-body">
<h4 class="card-title">Biography</h4>
</div>
</div>
</div>
<div class="col-md-4 clearfix d-none d-md-block">
<div class="card-body">
<h4 class="card-title">Horror</h4>
</div>
</div>
</div>
<div class="card-body">
<h4 class="card-title">Drama</h4>
</div>
</div>
</div>
</div>
</div>
<!--/.Third slide-->
</div>
<!--/.Slides-->
</div>
<!--/.Carousel Wrapper-->
</div>
{% endblock body %}
//pay.html
{% extends 'base.html' %}
{% load static %}
{% block body %}
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css'>
<link href='https://use.fontawesome.com/releases/v5.8.1/css/all.css'>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>
<script
src='https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js'></script>
</div>
<div class="card-header">
</ul>
<div class="tab-content">
<h6>Card Owner</h6>
<h6>Card number</h6>
</label>
</div>
</div>
<div class="row">
<div class="col-sm-8">
<h6>Expiration Date</h6>
</span></label>
</div>
</div>
<div class="col-sm-4">
</div>
</div>
</form>
</div>
<p class="text-muted"> Note: After clicking on the button, you will be directed to a
secure gateway for payment. After completing the payment process, you will be redirected back to
the website to view details of your order. </p>
</div> <!-- End -->
<option>Bank 1</option>
<option>Bank 2</option>
<option>Bank 3</option>
<option>Bank 4</option>
<option>Bank 5</option>
<option>Bank 6</option>
<option>Bank 7</option>
<option>Bank 8</option>
<option>Bank 9</option>
<option>Bank 10</option>
</select> </div>
<div class="form-group">
</div>
</div>
</div>
</div>
</div>
<style>
body {
background: #f5f5f5
.rounded {
border-radius: 1rem
.nav-pills .nav-link {
color: #555
.nav-pills .nav-link.active {
color: white
input[type="radio"] {
margin-right: 5px
.bold {
font-weight: bold
</style>
<script>
$(function() {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
{% endblock %}
//pdfpage.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>pdf</title>
</head>
<body>
</body>
</html>
//signup.html
{% extends 'base.html' %}
{% block body %}
<style>
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@600&display=swap');
:root{
--success-color:#2ecc71;
--error-color: #e74c3c;
.container{
background-color: #fff;
border-radius: 5px;
display: flex;
align-items: center;
justify-content: center;
margin-top: 10%;
width: 400px;
h2{
text-align: center;
margin: 0 0 20px;
.form{
.form-control{
margin-bottom: 10px;
padding-bottom: 20px;
position: relative;
.form-control label{
color: #777;
display: block;
margin-bottom: 5px;
.form-control input{
border-radius: 4px;
width: 100%;
padding: 10px;
font-size: 14px;
.form-control input:focus{
outline: 0;
border-color: #777;
.form-control.success input{
border-color:var(--success-color);
.form-control.error input{
border-color:var(--error-color);
.form-control small{
color: var(--error-color);
position: absolute;
bottom: 0;
left: 0;
visibility: hidden;
.form-control.error small{
visibility: visible;
}
.form button{
cursor: pointer;
background-color: #3498db;
border-radius: 4px;
color: #fff;
display: block;
font-size: 16px;
padding: 10px;
margin-top: 10px;
width: 100%;
</style>
<div class="container">
<div class="form-control">
<label for="username">Username</label>
<small>Error message</small>
</div>
<div class="form-control">
<label for="email">Email</label>
<small>Error message</small>
</div>
<div class="form-control">
<label for="password">Password</label>
<small>Error message</small>
</div>
<div class="form-control">
<small>Error message</small>
</div><br><br>
<button type="submit">Submit</button>
</form>
</div>
<script src="static/App.js"></script>
{% endblock body %}
/**Templates**/