* [gentoo-commits] proj/grumpy:master commit in: /, backend/
@ 2016-09-06 3:55 Mart Raudsepp
0 siblings, 0 replies; only message in thread
From: Mart Raudsepp @ 2016-09-06 3:55 UTC (permalink / raw
To: gentoo-commits
commit: eb0340055871dc67b6d96287f6ec869bda674d2f
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 6 03:50:47 2016 +0000
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Tue Sep 6 03:52:35 2016 +0000
URL: https://gitweb.gentoo.org/proj/grumpy.git/commit/?id=eb034005
Initial start of new Project Grumpy code; Hello World!
virtualenv -p python3 venv
venv/bin/activate
pip install -r requirements.txt
./manage.py runserver --help
./manage.py shell for a python shell with flask instance exported into "app" var
./manage.py runserver
.gitignore | 2 ++
backend/__init__.py | 7 +++++++
manage.py | 17 +++++++++++++++++
requirements.txt | 2 ++
4 files changed, 28 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0d27464
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+__pycache__
+venv/
diff --git a/backend/__init__.py b/backend/__init__.py
new file mode 100644
index 0000000..81ca7eb
--- /dev/null
+++ b/backend/__init__.py
@@ -0,0 +1,7 @@
+from flask import Flask
+
+app = Flask(__name__)
+
+@app.route("/")
+def hello_world():
+ return "Hello World!"
diff --git a/manage.py b/manage.py
new file mode 100755
index 0000000..b28d93a
--- /dev/null
+++ b/manage.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from flask_script import Manager, Shell
+
+from backend import app
+
+
+manager = Manager(app)
+
+def shell_context():
+ return dict(app=manager.app)
+
+manager.add_command('shell', Shell(make_context=shell_context))
+
+if __name__ == '__main__':
+ manager.run()
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..eaf59ef
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+Flask
+Flask-Script #manage.py
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-06 3:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-06 3:55 [gentoo-commits] proj/grumpy:master commit in: /, backend/ Mart Raudsepp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox