This Flask application displays at https://tymyrddin.dev/.
JAMStack: Frozen-Flask is used to generate the static files based on the routes specified in the Flask app. These static files are hosted on Netlify.
- Python 3.11
- Flask - micro-framework for web application development
- Jinga - templating engine
- Frozen-Flask - generates static files from Flask routes
Pull down the source code from this repository:
git clone [email protected]:tymyrddin/flask-tymyrddin.git
Create a new virtual environment:
$ cd flask-tymyrddin
$ python3 -m venv venv
Activate the virtual environment:
$ source venv/bin/activate
Install the python packages in requirements.txt:
(venv) $ pip install -r requirements.txt
In the top-level directory, set the file that contains the Flask application and specify that the development environment should be used:
(venv) $ export FLASK_APP=app.py
(venv) $ export FLASK_ENV=development
Run development server to serve the Flask application:
(venv) $ flask run -p 3000
Navigate to 'http://localhost:3000' to view the website!
In the top-level directory, run the build script:
(venv) $ python build.py
The static files are generated in the /project/build/ directory, which can then be hosted on Netlify.
To run all the tests:
(venv) $ pytest -v
To check the code coverage of the tests:
(venv) $ pytest --cov-report term-missing --cov=project