Skip to content

Instantly share code, notes, and snippets.

@Minobi
Created May 14, 2021 08:07
Show Gist options
  • Save Minobi/cb238645517a87387d55fd0c9c55e1d5 to your computer and use it in GitHub Desktop.
Save Minobi/cb238645517a87387d55fd0c9c55e1d5 to your computer and use it in GitHub Desktop.
Template file for running Flask in production on Repl.it with Gevent and Flask-Compress
# -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
from gevent.pywsgi import WSGIServer
from flask_compress import Compress
from flask import Flask, render_template
app = Flask(__name__)
compress = Compress()
compress.init_app(app)
@app.route('/')
def hello_world():
return render_template('index.html')
if __name__ == '__main__':
http_server = WSGIServer(('0.0.0.0', 8080), app)
http_server.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment