Flask

Preface

This tutorial is adapted from a forum post answered by Krydos, How do I use Flask on the HelioNet forum.

It is worth to note that flask on the Tommy and Johnny servers use python 3.7, and if you want to use flask on python 2.7 you have to be on the Ricky server.

About Flask

Flask is a Python web framework built with a small core and easy-to-extend philosophy. Full Stack Python

How to setup Flask

Create a folder in public_html called flask

/home/username/public_html/flask/

In that folder create a .htaccess file:

RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(admin_media/.*)$ - [L]
RewriteRule ^(flask\.wsgi/.*)$ - [L]
RewriteRule ^(.*)$ flask/flask.wsgi/$1 [QSA,PT,L]

Create a file named flask.wsgi in the flask directory.

Create a python script named myapp.py in the flask directory.

Last updated

Was this helpful?