Compare commits
2 Commits
c6381538ed
...
c68b0d527e
Author | SHA1 | Date | |
---|---|---|---|
c68b0d527e | |||
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