summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xindex.py20
-rwxr-xr-xmanage.py25
2 files changed, 25 insertions, 20 deletions
diff --git a/index.py b/index.py
deleted file mode 100755
index af0516b..0000000
--- a/index.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python2
-# -*- coding: utf-8 -*-
-
-import sys
-
-from app import app, db
-
-try:
- cmd = sys.argv[1]
-except IndexError:
- cmd = None
-
-if cmd == 'create':
- db.create_all()
-elif cmd == 'drop':
- db.drop_all()
-elif cmd == 'compile':
- app.jinja_env.compile_templates('comp', zip = None)
-else:
- app.run()
diff --git a/manage.py b/manage.py
new file mode 100755
index 0000000..9b26212
--- /dev/null
+++ b/manage.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python2
+# -*- coding: utf-8 -*-
+
+import sys
+
+from app import app, db
+from flask.ext.script import Manager
+
+manager = Manager(app)
+
+@manager.command
+def create():
+ db.create_all()
+
+@manager.command
+def drop():
+ db.drop_all()
+
+@manager.command
+def compile():
+ """Compiles all templates."""
+ app.jinja_env.compile_templates('comp', zip = None)
+
+if __name__ == "__main__":
+ manager.run(default_command="runserver")