Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

init from cmdline

  • Loading branch information...
commit e786c587ed6c12c4e48ed9d0d5562b21cb6a4688 1 parent 714c3c1
@jaramir authored
Showing with 10 additions and 7 deletions.
  1. +1 −0  .gitignore
  2. +0 −6 houserule/view.py
  3. +9 −1 run.py
View
1  .gitignore
@@ -3,3 +3,4 @@
*.wpu
.env
*.nja
+*.sqlite
View
6 houserule/view.py
@@ -52,9 +52,3 @@ def bggtest():
if form.validate_on_submit():
collection = pyBGG.collection( form.username.data, own=True, prefetch=True )
return render_template( "bggtest.html", form=form, collection=collection )
-
-#@app.route( "/initdb" )
-#@login_required
-#def initdb():
-# db.create_all()
-# return redirect( url_for( "index" ) )
View
10 run.py
@@ -1,10 +1,18 @@
#!/usr/bin/python
# coding: utf-8
-from houserule import app
+from houserule import app, db
+import argparse
import os
if __name__ == "__main__":
+ parser = argparse.ArgumentParser( description = "HouseRule Development Server" )
+ parser.add_argument( "--initdb", action="store_true", help="Create initial database" )
+ args = parser.parse_args()
+
+ if args.initdb:
+ db.create_all()
+
port = int( os.environ.get( "PORT", "5000" ) )
app.run( "0.0.0.0", port )
Please sign in to comment.
Something went wrong with that request. Please try again.