Skip to content
Snippets Groups Projects
Commit b6175e6e authored by hiruthikj's avatar hiruthikj
Browse files

added static template folders

parent ed4014e1
No related branches found
No related tags found
No related merge requests found
Showing
with 132 additions and 18 deletions
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -10,6 +10,7 @@ For the full list of settings and their values, see ...@@ -10,6 +10,7 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/ https://docs.djangoproject.com/en/3.1/ref/settings/
""" """
import os
from pathlib import Path from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
...@@ -49,6 +50,8 @@ MIDDLEWARE = [ ...@@ -49,6 +50,8 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
# added middlewares
'django.contrib.auth.middleware.AuthenticationMiddleware',
] ]
ROOT_URLCONF = 'book_management_system.urls' ROOT_URLCONF = 'book_management_system.urls'
...@@ -111,7 +114,7 @@ AUTH_PASSWORD_VALIDATORS = [ ...@@ -111,7 +114,7 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC' TIME_ZONE = 'Asia/Kolkata'
USE_I18N = True USE_I18N = True
...@@ -124,3 +127,13 @@ USE_TZ = True ...@@ -124,3 +127,13 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.1/howto/static-files/ # https://docs.djangoproject.com/en/3.1/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
# os.path.dirname(os.path.realpath(__file__)) + '/static/',
]
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
LOGIN_URL = '/students/login/'
"""book_management_system URL Configuration
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.contrib import admin
from django.urls import path from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
] path('booksite/', include('online_books.urls')),
\ No newline at end of file ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
File added
File added
No preview for this file type
No preview for this file type
/* body, html {
height: 100%;
background-repeat: no-repeat;
background-repeat: repeat;
background-image: linear-gradient(rgb(104, 145, 162), rgb(12, 97, 33));
background-attachment: fixed;
} */
#MyNav{
margin-bottom: 10px;
}
#univLogo{
color: darkorange;
}
body, html {
height: 100%;
background-repeat: no-repeat;
background-attachment: fixed;
/* background-color: #85FFBD;
background-image: linear-gradient(45deg, #85FFBD 0%, #FFFB7D 100%); */
/* background-image: radial-gradient( circle farthest-corner at 10% 20%, rgba(153,103,186,1) 41.2%, rgba(0,113,227,1) 90% ); */
background-image: radial-gradient( circle farthest-corner at 10% 20%, rgba(147,230,241,1) 0%, rgba(145,192,241,1) 45.5% );
}
\ No newline at end of file
{% load static %}
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}Default Title{% endblock %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/5.1.1/bootstrap-social.min.css" integrity="sha512-f8mUMCRNrJxPBDzPJx3n+Y5TC5xp6SmStstEfgsDXZJTcxBakoB5hvPLhAfJKa9rCvH+n3xpJ2vQByxLk4WP2g==" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous">
<link rel="stylesheet" href="{% static 'online_books/css/base.css' %}">
{% block head %}{% endblock %}
</head>
<body>
{% block nav %}
<nav class="navbar navbar-expand-lg navbar-extend-sm navbar-dark bg-dark" id="MyNav">
<div class="container">
<a class="navbar-brand" id="univLogo" href="{% url 'stud_app:home' username %}"><span class="fas fa-university"> Online Exam System</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#Navbar">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id='Navbar'>
<div class="navbar-nav">
<a class="nav-item nav-link {% if current_page == 'home' %}active{% endif %}" href="{% url 'stud_app:home' username %}"><span class="fas fa-user-graduate"></span> My Details</a>
<a class="nav-item nav-link {% if current_page == 'courses' %}active{% endif %}" href="{% url 'stud_app:courses' username %}"><span class="fas fa-book-open"></span> Courses</a>
<a class="nav-item nav-link {% if current_page == 'exams' %}active{% endif %}" href="{% url 'stud_app:exams' username %}"><span class="fas fa-edit"></span> Exams</a>
<a class="nav-item nav-link {% if current_page == 'scores' %}active{% endif %}" href="{% url 'stud_app:scores' username %}"><span class="fas fa-file-alt"></span> Scores</a>
</div>
<div class="navbar-nav ml-auto">
<a class="nav-item nav-link ml-auto" href="{% url 'stud_app:logout' %}"><span class="fas fa-sign-out-alt"></span> Log Out</a>
</div>
</div>
</div>
</nav>
{% endblock %}
<!-- {% block breadcrumb %}
<ol class="breadcrumb container">
<li class="breadcrumb-item active"><a href="#">Home</a></li>
</ol>
{% endblock %} -->
{% block content %}
{% endblock %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</body>
</html>
from django.conf.urls import url,include
from django.urls import path
from . import views
# from .forms import StudentLoginForm
from django.contrib.auth.views import *
#LoginView,LogoutView,PasswordResetView,PasswordResetDoneView,PasswordResetConfirmView,PasswordResetCompleteView
app_name = 'online_books'
urlpatterns = [
# path('', LoginView.as_view(template_name='stud_app/login.html',authentication_form=StudentLoginForm), name="login"),
# url('login/', views.StudentView.as_view(), name="login"),
# path('', views.blank_page),
# path('login/', views.login_view, name="login"),
path('login/', login, name="login"),
path('logout/', LogoutView.as_view(template_name='online_books/logout.html'), name="logout"),
# path('<username>/home/', views.home_view, name="home"),
# path('<username>/courses/', views.courses_view, name="courses"),
# path('<username>/exams/', views.exam_list_view, name="exams"),
# path('<username>/exams/<int:exam_id>', views.exam_view, name="exams"),
# path('<username>/scores/', views.scores_view, name="scores"),
]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment