First, git clone and navigate inside the directory by running these commands:
git clone https://github.com/umd-python-cas/flask-demo.git
cd flask-demoThen, install the dependencies:
pip install -r requirements.txtFinally, run the flask webserver locally. The environment variable FLASK_APP tells flask what python file to run, and FLASK_DEBUG tells flask to restart the server when any changes are made to the code.
FLASK_APP=flask_client_demo.py \
FLASK_DEBUG=1 \
flask runGo to http://127.0.0.1:5000/ in your browser to view the app.
The following are instructions on how this template was made, so you can better understand how to integrate umd-cas-python into your project.
First, install flask and umd-python-cas, and create a new folder for the project, by running these commands:
pip install flask umd-python-cas
mkdir flask-demo
cd flask-demoCreate a file flask_client_demo.py with the contents of this file. In the file, change app.secret_key = "test12345" to be a random value.
Create a folder templates by running mkdir templates.
Create a file templates/index.html with the contents of this file.
Run the flask webserver locally. The environment variable FLASK_APP tells flask what python file to run, and FLASK_DEBUG tells flask to restart the server when any changes are made to the code.
FLASK_APP=flask_client_demo.py \
FLASK_DEBUG=1 \
flask runGo to http://127.0.0.1:5000/ in your browser to view the app.