[dev-gnome-web] Render index.html as a template
- From: Lasse Schuirmann <lschuirma src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dev-gnome-web] Render index.html as a template
- Date: Thu, 28 Jan 2016 11:15:56 +0000 (UTC)
commit 4e29fc598ddc867b85d09bb6a32c6121a0377ee3
Author: Lasse Schuirmann <lasse schuirmann gmail com>
Date: Thu Jan 28 12:15:24 2016 +0100
Render index.html as a template
server/app.py | 6 ++++++
server/index.py | 15 +++++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/server/app.py b/server/app.py
index aac4b4b..2ac8019 100644
--- a/server/app.py
+++ b/server/app.py
@@ -22,3 +22,9 @@ babel = Babel(app)
@babel.localeselector
def get_locale():
return request.accept_languages.best_match(app.config['LANGUAGES'])
+
+# Start ignoring PyImportSortBear and PyLintBear (Those imports use app)
+
+from . import index
+
+# Stop ignoring
diff --git a/server/index.py b/server/index.py
new file mode 100644
index 0000000..cd26049
--- /dev/null
+++ b/server/index.py
@@ -0,0 +1,15 @@
+"""
+Renders the index.html as a template.
+"""
+from flask.templating import render_template
+
+from .app import app
+
+
+ app route('/')
+ app route('/index')
+def index():
+ r"""
+ Renders the index.html as a template.
+ """
+ return render_template('index.html')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]