Commit 591f5b34 authored by Lance Andrei Tan's avatar Lance Andrei Tan

Initital commit

parents
Pipeline #1511 failed with stages
"""
ASGI config for Lab1_bujo project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Lab1_bujo.settings')
application = get_asgi_application()
"""
Django settings for Lab1_bujo project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '5+*3+im59nhh7ub*=y)v_^(jam0@*9x9iu7=@+ly&+-w3#_e!c'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'Lab1_bujo.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'Lab1_bujo/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',
],
},
},
]
WSGI_APPLICATION = 'Lab1_bujo.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.1/howto/static-files/
STATIC_URL = '/static/'
{% extends 'hyperlinks.html' %}
{% block content %}
<title> Your Bujo </title>
<style>
div {text-align: center;}
</style>
<h1 style="text-align:center; color:white;">space</h1>
<h1 style="text-align:center; color:white;">space</h1>
<h1 style="text-align:center; color:white;">space</h1>
<h1 style="text-align:center; color:white;">space</h1>
<h1 style="text-align:center; color:white;">space</h1>
<center>
<header> <h1>Your Bullet Journal</h1> </header>
<body>
<p>Hello! What is your name?</p>
{% if name %}
Hello, {{name}}! Today is going to be a great day! <br>
{% else %}
<form action="/home" method = "POST">
{% csrf_token %}
{{ form }}
<input type='submit' name ='Submit'>
</form>
{% endif %}
</body>
</center>
{% endblock %}
{% block title %} {% endblock %}
{% block styles %}{% endblock %}
{% block content %}
{{username}}
{% endblock %}
<div class=directory>
<h3>
<a href='home'> Home </a> &nbsp; &nbsp;
<a href='profile'> Profile </a> &nbsp; &nbsp;
<a href='key'> Key </a> &nbsp; &nbsp;
<a href='this_week'> This Week </a> &nbsp; &nbsp;
<a href='today'> Today </a> &nbsp; &nbsp;
</h3>
</div>
{% extends 'hyperlinks.html' %}
{% block content %}
<title> Key </title>
<header>
<h1 style="font-size:500%; font-family:verdana;"> Key </h1>
</header>
<style>
</style>
<body>
<p1><b>&nbsp; &nbsp; Tasks:</b> things you have to do</p1> <br><br>
<p2><b> - &nbsp; &nbsp; Notes:</b> Things you don't want to forget </p2> <br><br>
<p3><b>&nbsp; &nbsp; Events:</b> Noteworth moments in time </p3> <br><br>
<p4><b>&nbsp; &nbsp; Tasks complete </p4> <br><br>
<p5><b> X &nbsp; &nbsp; Task incomplete </p5>
</body>
{% endblock %}
{% extends 'hyperlinks.html' %}
{% block content %}
<title> Profile </title>
<header>
<h1 style="font-size:500%; font-family:verdana;"> Profile </h1>
</header>
<img src="https://inteng-storage.s3.amazonaws.com/images/AUGUST/sizes/robert-wadlow-3_resize_md.jpg" alt="photo" width="500" height="600">
<p style="font-size:150%;"><b><u>My Name:</u></b> Robert Wadlow</p>
<p style="font-size:150%;"><b><u>Who is Robert Wadlow:</u></b> He is the tallest man in the world.</p>
{% endblock %}
{% extends 'hyperlinks.html' %}
{% block content %}
<title> This Week </title>
<header>
<h1 style="font-size:500%; font-family:verdana;"> This Week </h1>
<h2> 03.15.MON - 03.21.SUN </h2>
</header>
<body>
<p2><b></b> buy magnum in sm </p> <br>
<p3><b></b> feed Zoey the dog </p> <br>
<p4><b></b> study history </p> <br>
<p5><b></b> don't skip meals </p> <br>
<p6><b></b> finish research project </p> <br>
<p7><b></b> exercise everyday at 4pm </p>
</body>
{% endblock %}
{% extends 'hyperlinks.html' %}
{% block content %}
<title>Today</title>
<header>
<h1 style="font-size:500%; font-family:verdana;"> Today </h1>
<h2> 03.17.WED </h2>
</header>
<body>
<p2><b></b> eat banana </p2> <br>
<p3><b></b> clean the pantry </p3> <br>
<p4><b></b> fold the clothes </p4> <br>
<p5><b></b> buy pork </p5> <br>
<p6><b></b> charge battery pack </p6> <br>
<p7><b></b> wipe the cabinet </p7>
</body>
{% endblock %}
"""tan_lab1 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.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('',include('apps.urls'))
]
"""
WSGI config for Lab1_bujo project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Lab1_bujo.settings')
application = get_wsgi_application()
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class AppsConfig(AppConfig):
name = 'apps'
from django import forms
class Name_Form(forms.Form):
name_input = forms.CharField(label='Name:', max_length=50)
from django.db import models
# Create your models here.
from django.test import TestCase
# Create your tests here.
from django.urls import path
from .views import home
from .views import profile
from .views import key
from .views import this_week
from .views import today
urlpatterns = [
path('home', home, name="home"),
path('profile', profile,name="profile"),
path('key',key, name="key"),
path('this_week', this_week,name="this_week"),
path('today', today,name="today")
]
from django.shortcuts import render
from django.http import HttpResponse
from .forms import Name_Form
def home(request):
if request.method == 'POST':
form = Name_Form(request.POST)
if form.is_valid():
return render(request, 'home.html', {'name': form.cleaned_data['name_input']})
else:
form = Name_Form()
return render(request, 'home.html', {'form': form})
def profile(request):
return render(request,'profile.html')
def key(request):
return render(request,'key.html')
def this_week(request):
return render(request,'thisweek.html')
def today(request):
return render(request,'today.html')
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Lab1_bujo.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment