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]
|
[packages]
|
||||||
pipfile = "*"
|
pipfile = "*"
|
||||||
flask = "*"
|
flask = "*"
|
||||||
|
flask-login = "*"
|
||||||
psycopg2-binary = "*"
|
psycopg2-binary = "*"
|
||||||
sqlalchemy = "*"
|
sqlalchemy = "*"
|
||||||
flask-sqlalchemy = "*"
|
flask-sqlalchemy = "*"
|
||||||
|
|
18
app.py
18
app.py
|
@ -1,6 +1,24 @@
|
||||||
from .lib.helpers import get_static_paths, get_content_text
|
from .lib.helpers import get_static_paths, get_content_text
|
||||||
from flask import Flask, render_template, redirect, url_for, request
|
from flask import Flask, render_template, redirect, url_for, request
|
||||||
|
from flask_login import LoginManager
|
||||||
app = Flask(__name__)
|
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'])
|
@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,20 +1,50 @@
|
||||||
{% extends 'index.html' %}
|
{% extends 'index.html' %} {% block header %}
|
||||||
|
<h1 class="blue-grey-text text-lighten-5 center">
|
||||||
{% block header %}
|
UwU Me!
|
||||||
<h1 class="blue-grey-text text-lighten-5 center">
|
</h1>
|
||||||
UwU Me!
|
<h5 class="grey-text text-lighten-1 center">
|
||||||
</h1>
|
Login Page
|
||||||
<h5 class="grey-text text-lighten-1 center">
|
</h5>
|
||||||
Login Page
|
{% endblock %} {% block content %}
|
||||||
</h5>
|
<div class="card-panel grey darken-3">
|
||||||
{% endblock %}
|
<div class="row">
|
||||||
|
<form class="col s12" action="" method="post">
|
||||||
{% block content %}
|
<div class="row">
|
||||||
<div class="card-panel grey darken-3">
|
<div class="input-field col s6">
|
||||||
{% for item in content_text %}
|
<input
|
||||||
<p class="blue-grey-text text-lighten-5">
|
type="text"
|
||||||
{{ item }}
|
placeholder="Username"
|
||||||
</p>
|
name="username"
|
||||||
{% endfor %}
|
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>
|
||||||
{% endblock %}
|
</div>
|
||||||
|
<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 %}
|
||||||
|
|
Reference in a new issue