Browse Source

added app and gitignore

main
david 5 years ago
parent
commit
f6abf5dc3b
  1. 5
      .gitignore
  2. 57
      app.py

5
.gitignore

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

57
app.py

@ -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)