Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added some templates #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified quizapp/quizapp/__pycache__/settings.cpython-39.pyc
Binary file not shown.
10 changes: 8 additions & 2 deletions quizapp/quizapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
https://docs.djangoproject.com/en/4.1/ref/settings/
"""

from pathlib import Path
from pathlib import Path,os

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand Down Expand Up @@ -116,7 +116,13 @@
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/

STATIC_URL = "static/"
STATIC_URL = "/static/"
STATIC_ROOT = '/static/'
MEDIA_ROOT = os.path.join(BASE_DIR,'media/')
MEDIA_URL = '/media/'
STATICFILES_DIRS=[
os.path.join(BASE_DIR,'static')
]

# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
Expand Down
Binary file modified quizapp/quizzer/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file modified quizapp/quizzer/__pycache__/views.cpython-39.pyc
Binary file not shown.
34 changes: 34 additions & 0 deletions quizapp/quizzer/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %} {% endblock title %}</title>
<link rel="stylesheet" href="static/quizzer/style.css">
</head>
<body>
<div id="header">
<div class="container">
<nav>
<ul id="side menu">
<li> <a href="{%url 'home'%}">Home</a></li>
<li> <a href="{%url 'quize'%}">Quize</a></li>
<li> <a href="#">User</a></li>
</ul>
</nav>
</div>
</div>
<div id="home">
<div class="container">
{% block h1 %} {% endblock h1 %}
{% block p %} {% endblock p %}
</div>
</div>
<div id="quize">
<div class="container">
{% block p1 %} {% endblock p1 %}
</div>
</div>
</body>
</html>
9 changes: 8 additions & 1 deletion quizapp/quizzer/templates/home.html
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
<h1>WWE</h1>
{% extends 'base.html'%}
{% block title %} Home {%endblock title %}
{% block h1 %}
<h1> Welcome to Quizzer </h1>
{% endblock h1 %}
{% block p %}
<p>Test your Knowledge about technology <br>Best of LUCK !</p>
{% endblock p %}
3 changes: 3 additions & 0 deletions quizapp/quizzer/templates/quize.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% extends 'base.html'%}
{% block title %} Quize {%endblock title %}
{% block p1 %}<h1> Welcome </h1> {% endblock p1 %}
3 changes: 2 additions & 1 deletion quizapp/quizzer/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
from quizzer import views

urlpatterns = [
path('',views.home, name='home')
path('',views.home, name='home'),
path('quize',views.quize, name='quize')
]
7 changes: 5 additions & 2 deletions quizapp/quizzer/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from django.shortcuts import render,HttpResponse
from django.shortcuts import render

# Create your views here.
def home(request):
return render (request,'home.html')
return render (request,'home.html')

def quize(request):
return render (request,'quize.html')
67 changes: 67 additions & 0 deletions quizapp/static/quizzer/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
*{
margin: 0;
padding: 0;
font-family: 'Poppins', sans-serif;
box-sizing: border-box;
}

html{
scroll-behavior: smooth;
}
body{
background-color: rgb(255, 233, 215);
color: #fff;
}
#header{

background-size: cover;
background-position: center;
}
.container{
padding: 10px 3%;
}

nav{
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
}

nav ul li{
display: inline-block;
list-style: none;
margin: 10px 20px;
}

nav ul li a{
text-decoration: none;
color: #000000;
font-size: 18px;
position: relative;
}

#home{
margin: 0 30px;
background-color: rgb(22, 7, 65);
height: 80vh;
border-radius: 7px;
}

.container h1{
font-size: 80px;
padding-top: 9%;
text-align: center;
align-content: center;
}

.container p{
font-size: 20px;
padding-top: 3%;
text-align: center;
align-content: center;
}

#quize{

}