Initial login manager placeholders set.
This commit is contained in:
parent
bd4ee67144
commit
677e7908ce
7 changed files with 84 additions and 19 deletions
1
Pipfile
1
Pipfile
|
@ -11,6 +11,7 @@ pipfile = "*"
|
|||
[packages]
|
||||
pipfile = "*"
|
||||
flask = "*"
|
||||
flask-login = "*"
|
||||
psycopg2-binary = "*"
|
||||
sqlalchemy = "*"
|
||||
flask-sqlalchemy = "*"
|
||||
|
|
18
app.py
18
app.py
|
@ -1,6 +1,24 @@
|
|||
from .lib.helpers import get_static_paths, get_content_text
|
||||
from flask import Flask, render_template, redirect, url_for, request
|
||||
from flask_login import LoginManager
|
||||
app = Flask(__name__)
|
||||
'''
|
||||
login_manager = LoginManager()
|
||||
login_manager.init_app(app)
|
||||
|
||||
# Secret key
|
||||
app.secret_key = #Don't commit this.
|
||||
|
||||
|
||||
@login_manager.user_loader
|
||||
def load_user(user_id):
|
||||
return User.get(user_id)
|
||||
'''
|
||||
|
||||
|
||||
@app.route('/home', methods=['GET'])
|
||||
def home():
|
||||
return render_template('home/index.html', user='admin', static_paths=get_static_paths(), content_text=get_content_text())
|
||||
|
||||
|
||||
@app.route('/login', methods=['GET', 'POST'])
|
||||
|
|
0
assets/home/content.txt
Normal file
0
assets/home/content.txt
Normal file
0
static/css/home/index.css
Normal file
0
static/css/home/index.css
Normal file
0
static/js/home/index.js
Normal file
0
static/js/home/index.js
Normal file
16
templates/home/index.html
Normal file
16
templates/home/index.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% extends 'index.html' %} {% block header %}
|
||||
<h1 class="blue-grey-text text-lighten-5 center">
|
||||
UwU Me!
|
||||
</h1>
|
||||
<h5 class="grey-text text-lighten-1 center">
|
||||
Hello, {{ user }}
|
||||
</h5>
|
||||
{% endblock %} {% block content %}
|
||||
<div class="card-panel grey darken-3">
|
||||
{% for item in content_text %}
|
||||
<p class="blue-grey-text text-lighten-5">
|
||||
{{ item }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,15 +1,45 @@
|
|||
{% extends 'index.html' %}
|
||||
|
||||
{% block header %}
|
||||
{% extends 'index.html' %} {% block header %}
|
||||
<h1 class="blue-grey-text text-lighten-5 center">
|
||||
UwU Me!
|
||||
</h1>
|
||||
<h5 class="grey-text text-lighten-1 center">
|
||||
Login Page
|
||||
</h5>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% endblock %} {% block content %}
|
||||
<div class="card-panel grey darken-3">
|
||||
<div class="row">
|
||||
<form class="col s12" action="" method="post">
|
||||
<div class="row">
|
||||
<div class="input-field col s6">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
name="username"
|
||||
value="{{
|
||||
request.form.username }}"
|
||||
/>
|
||||
</div>
|
||||
<div class="input-field col s6">
|
||||
<input
|
||||
type="password"
|
||||
placeholder="Password"
|
||||
name="password"
|
||||
value="{{
|
||||
request.form.password }}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="center">
|
||||
<button
|
||||
class="waves-effect waves-light btn blue darken-2"
|
||||
type="submit"
|
||||
>
|
||||
Login
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-panel grey darken-3">
|
||||
{% for item in content_text %}
|
||||
<p class="blue-grey-text text-lighten-5">
|
||||
|
|
Reference in a new issue