Base de serveur

This commit is contained in:
theo@manjaro 2021-12-02 19:05:44 +01:00
parent 397514edaf
commit aa7e37ddfe
4 changed files with 24 additions and 0 deletions

9
app.py Normal file
View File

@ -0,0 +1,9 @@
# Fichier principal
from flask import Flask, escape, request
import pages
app = Flask(__name__)
@app.route('/')
def main():
return pages.main()

8
definitions.py Normal file
View File

@ -0,0 +1,8 @@
### Fonctions communes
def read(path):
# Retourne le contenu texte d'un fichier
f = open(path,'r')
result = f.read()
f.close()
return result

4
pages.py Normal file
View File

@ -0,0 +1,4 @@
import definitions as lib
def main():
return lib.read("templates/main.html")

3
templates/main.html Normal file
View File

@ -0,0 +1,3 @@
<h1>Bienvenue !</h1>
<p>Ceci est la page d'accueil !</p>