zeroth
6 years ago
7 changed files with 84 additions and 6 deletions
@ -0,0 +1,32 @@ |
|||
from flask import Flask, url_for, render_template, Markup, redirect, request, flash |
|||
from flask import session as login_session |
|||
from flask_wtf import FlaskForm |
|||
from wtforms.validators import DataRequired |
|||
from wtforms import Form, TextField, TextAreaField, BooleanField, validators, StringField, SubmitField |
|||
from forms import ReusableForm |
|||
from config import Config |
|||
import json |
|||
|
|||
app = Flask(__name__, static_url_path='', static_folder="static", template_folder="templates") |
|||
app.config.from_object(Config) |
|||
|
|||
@app.route("/") |
|||
def home(): |
|||
return render_template('home.html') |
|||
|
|||
@app.route('/about/') |
|||
def about(): |
|||
return render_template('about.html') |
|||
|
|||
@app.route('/description/', methods=['GET', 'POST']) |
|||
def description(): |
|||
form = ReusableForm(request.form) |
|||
print (form.errors) |
|||
if request.method == 'POST' and form.validate(): |
|||
return 'Success' |
|||
return render_template('description.html', form=form) |
|||
|
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
app.run(debug=True) |
@ -0,0 +1,4 @@ |
|||
body{ |
|||
background: lavender; |
|||
color:blue; |
|||
} |
@ -0,0 +1,10 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<body> |
|||
{% extends "layout.html" %} |
|||
{% block content %} |
|||
<div class="about"> |
|||
<h1>About me</h1> |
|||
<p>This is a portfolio site about anything that can be put in a portfolio.</p> |
|||
</div> |
|||
{% endblock %} |
@ -0,0 +1,7 @@ |
|||
{% extends "layout.html" %} |
|||
{% block content %} |
|||
<div class="home"> |
|||
<h1>THIS IS THE HOME PAGE</h1> |
|||
<p>This website was built with Python via the Flask framework.</p> |
|||
</div> |
|||
{% endblock %} |
@ -0,0 +1,25 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<title>PARTOUT TITRE PARTOUT</title> |
|||
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}"> |
|||
</head> |
|||
<body> |
|||
<header> |
|||
<div class="container"> |
|||
<h1 class="logo">SUPERB</h1> |
|||
<strong><nav> |
|||
<ul class="menu"> |
|||
<li><a href="{{ url_for('home') }}">Home</a></li> |
|||
<li><a href="{{ url_for('about') }}">About</a></li> |
|||
<li><a href="{{ url_for('description') }}">Form</a></li> |
|||
</ul> |
|||
</nav></strong> |
|||
</div> |
|||
</header> |
|||
<div class="container"> |
|||
{% block content %} |
|||
{% endblock %} |
|||
</div> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue