From 5e4487a99f357c08662ed5dabd0c7f21664c15eb Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Mon, 13 Nov 2023 12:42:36 -0500 Subject: Add site index and sample dashboard BP --- ustayml/__init__.py | 24 +++++++-------- ustayml/templates/auth/login.html | 8 ++--- ustayml/templates/auth/register.html | 10 +++---- ustayml/templates/base.html | 2 +- ustayml/templates/dashboard/index.html | 51 ++++++++++++++++++++++++++++++++ ustayml/templates/index.html | 15 ++++++++++ ustayml/templates/load_data/index.html | 9 +++--- ustayml/templates/load_data/success.html | 2 +- ustayml/views/dashboard.py | 37 +++++++++++++++++++++++ ustayml/views/load_data.py | 2 +- ustayml/views/students.py | 2 +- 11 files changed, 133 insertions(+), 29 deletions(-) create mode 100644 ustayml/templates/dashboard/index.html create mode 100644 ustayml/templates/index.html diff --git a/ustayml/__init__.py b/ustayml/__init__.py index fbe1b3a..9e57bc4 100644 --- a/ustayml/__init__.py +++ b/ustayml/__init__.py @@ -1,6 +1,6 @@ import os -from flask import Flask +from flask import Flask, render_template def create_app(test_config=None): @@ -25,24 +25,24 @@ def create_app(test_config=None): except OSError: pass - # Routes - @app.route('/hello') - def hello(): - return 'Hello, World!' - - # Register functions and blueprints from . import db db.init_app(app) - # from .views import blog - # app.register_blueprint(blog.bp) + # Register functions and blueprints - from .views import auth, students, load_data + @app.route('/') + def index(): + return render_template('index.html') + + from .views import ( + auth, + students, load_data, dashboard + ) app.register_blueprint(auth.bp) app.register_blueprint(students.bp) app.register_blueprint(load_data.bp) + app.register_blueprint(dashboard.bp) - # Extra - app.add_url_rule('/', endpoint='index') + # app.add_url_rule('/', endpoint='index') return app \ No newline at end of file diff --git a/ustayml/templates/auth/login.html b/ustayml/templates/auth/login.html index 45acd7f..9560ba5 100644 --- a/ustayml/templates/auth/login.html +++ b/ustayml/templates/auth/login.html @@ -1,15 +1,15 @@ {% extends 'base.html' %} {% block header %} -

{% block title %}Log In{% endblock %}

+

{% block title %}Ingresar{% endblock %}

{% endblock %} {% block content %}
- + - + - +
{% endblock %} \ No newline at end of file diff --git a/ustayml/templates/auth/register.html b/ustayml/templates/auth/register.html index a3c73cc..ef1264d 100644 --- a/ustayml/templates/auth/register.html +++ b/ustayml/templates/auth/register.html @@ -1,15 +1,15 @@ {% extends 'base.html' %} {% block header %} -

{% block title %}Register{% endblock %}

+

{% block title %}Registrarse{% endblock %}

{% endblock %} {% block content %} -
- + + - + - +
{% endblock %} \ No newline at end of file diff --git a/ustayml/templates/base.html b/ustayml/templates/base.html index eefbc06..580249a 100644 --- a/ustayml/templates/base.html +++ b/ustayml/templates/base.html @@ -5,7 +5,7 @@