david/factoriocp
david
/
factoriocp
Archived
1
0
Fork 0

added app and gitignore

This commit is contained in:
david 2016-11-19 09:38:09 +01:00
parent 59695c010a
commit f6abf5dc3b
2 changed files with 62 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
*.conf
bottle.py
__pycache__
__pycache__/*
*.pyc

57
app.py Normal file
View File

@ -0,0 +1,57 @@
# imports
import requests
from configparser import ConfigParser
from bottle import route, run, template, error, get, \
post, request, response, redirect, \
static_file
# config
configfile = "app.conf"
config = ConfigParser()
config.read(configfile)
if config['DEFAULT']['app_name']:
app_name = config['DEFAULT']['app_name']
else:
app_name = "FactorioCP"
if config['DEFAULT']['static_files']:
static_files = config['DEFAULT']['static_files']
else:
static_files = "static"
if config['DEFAULT']['cookie_secret']:
cookie_secret = config['DEFAULT']['cookie_secret']
else:
cookie_secret = "norealsecretDTR47SNI2390LGFsn4T-LASED2309h"
if config['DEFAULT']['cookie_max_age']:
cookie_max_age = int(config['DEFAULT']['cookie_max_age'])
else:
cookie_max_age=3600
if config['DEFAULT']['cookie_name']:
cookie_name = config['DEFAULT']['cookie_name']
else:
cookie_name = "factoriocp"
# functions
# routing
@get('/')
def home():
pass
# run development webserver
run(host='localhost', port=8000, debug=True, reloader=True)
# run prod server
#run(host='0.0.0.0', port=8000)