This commit is contained in:
andis
2017-02-01 22:25:22 +01:00
parent 130f2ac1c6
commit 8f2c984b18
3 changed files with 7 additions and 6 deletions

0
__init__.py Normal file
View File

10
cont.py
View File

@@ -9,7 +9,7 @@ from os.path import isfile, join
DEBUG = True DEBUG = True
FLATPAGES_AUTO_RELOAD = DEBUG FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = '.md' FLATPAGES_EXTENSION = '.md'
FLATPAGES_ROOT = 'contents' FLATPAGES_ROOT = '/mnt/data'
POST_DIR = 'posts' POST_DIR = 'posts'
import re import re
app = Flask(__name__) app = Flask(__name__)
@@ -46,9 +46,9 @@ def get_flatpage(path):
else: else:
page=flatpages.get(path) page=flatpages.get(path)
return (is_index, path, page) return (is_index, path, page)
@app.route('/')
@app.route('/fet_daten/<path:name>/') @app.route('/<path:name>/')
def post(name): def post(name='index'):
is_index, path, page = get_flatpage(name) is_index, path, page = get_flatpage(name)
if is_index == True and not page is None: if is_index == True and not page is None:
@@ -84,4 +84,4 @@ if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "build": if len(sys.argv) > 1 and sys.argv[1] == "build":
freezer.freeze() freezer.freeze()
else: else:
app.run(host='0.0.0.0', debug=True) app.run(host='0.0.0.0',port=4444, debug=True)

View File

@@ -1,3 +1,4 @@
flask flask
flask_flatpages flask_flatpages
flask_frozen Frozen-Flask
config