1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

Even better backend structure

This commit is contained in:
Nemesis 2021-04-19 16:23:50 +02:00
parent 9a55ea049e
commit ee3f696aef
5 changed files with 23 additions and 5 deletions

View file

@ -1,8 +1,8 @@
from flask import Flask
import os
import werkzeug.middleware.proxy_fix
from .routes import doa
from .database.base import Base
from .routes import *
from .database import Base
app = Flask(__name__)
@ -14,7 +14,7 @@ reverse_proxy_app = werkzeug.middleware.proxy_fix.ProxyFix(app=app, x_for=1, x_p
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:password@localhost:5432/PdSDev'
# Routes setup
app.add_url_rule("/doa", view_func=doa.page, methods=["GET"])
app.add_url_rule("/doa", view_func=page_doa, methods=["GET"])
if __name__ == "__main__":
try:

View file

@ -0,0 +1,6 @@
from .tables import *
from .base import Base
"""
This module imports all the tables and the declarative base
"""

View file

@ -0,0 +1,5 @@
from .Utente import Utente
"""
This module contains all database classes.
"""

View file

@ -0,0 +1,5 @@
from .doa import page_doa
"""
This module imports all the routes that return something to the frontend.
"""

View file

@ -1,9 +1,11 @@
from flask import render_template, abort
from ..database.tables.Utente import Utente
from ..database import *
"""
Page that displays a message if the server is on
"""
def page():
def page_doa():
utente = Utente()
return "If you see this, the server is fine."