Add flask freeze to make a static site
This commit is contained in:
parent
a796ccd29a
commit
4b59780b41
@ -1,9 +1,12 @@
|
||||
appdirs==1.4.3
|
||||
click==6.7
|
||||
Flask==0.12
|
||||
Frozen-Flask==0.14
|
||||
itsdangerous==0.24
|
||||
Jinja2==2.9.5
|
||||
MarkupSafe==0.23
|
||||
packaging==16.8
|
||||
pkg-resources==0.0.0
|
||||
pyparsing==2.1.10
|
||||
six==1.10.0
|
||||
Werkzeug==0.11.15
|
||||
|
@ -1,7 +1,9 @@
|
||||
from flask import Flask, render_template, send_from_directory
|
||||
from flask_frozen import Freezer
|
||||
import os
|
||||
|
||||
app = Flask(__name__)
|
||||
freezer = Freezer(app)
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/index')
|
||||
@ -44,7 +46,6 @@ def show_project(category, project_name):
|
||||
@app.route('/projects/<category>/<project_name>/<filename>')
|
||||
def show_project_file(category, project_name, filename):
|
||||
return send_from_directory('projects/' + category + '/'+ project_name + '/', filename)
|
||||
# return 'projects/' + category + '/'+ project_name + '/', filename
|
||||
|
||||
@app.route('/about')
|
||||
def about():
|
||||
@ -64,3 +65,5 @@ def portfolio():
|
||||
def contact():
|
||||
return render_template('contactus.html', title="Contact Us - JPs Contracting")
|
||||
|
||||
if __name__ == '__main__':
|
||||
freezer.freeze()
|
||||
|
Loading…
Reference in New Issue
Block a user