Base de serveur
This commit is contained in:
parent
397514edaf
commit
aa7e37ddfe
9
app.py
Normal file
9
app.py
Normal 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
8
definitions.py
Normal 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
4
pages.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import definitions as lib
|
||||||
|
|
||||||
|
def main():
|
||||||
|
return lib.read("templates/main.html")
|
3
templates/main.html
Normal file
3
templates/main.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<h1>Bienvenue !</h1>
|
||||||
|
|
||||||
|
<p>Ceci est la page d'accueil !</p>
|
Loading…
Reference in New Issue
Block a user