This is the code for the kelsoncraft.net website which is running on Python Flask
I have a dark mode toggle for the website, and I'm using bootstrap v5.
Website Link: (https://kelsoncraft.net)
- Bootstrap is loaded in this file: FlaskWeb/templates/head.html
- The navbar is in this file: FlaskWeb/templates/header.html
- The footer is in this file: FlaskWeb/templates/footer.html
- The dark mode javascript files, css, and other javascript files are here: FlaskWeb/Static
- Example .env file: FlaskWeb/.env.example
- The html files are here: FlaskWeb/templates
To run
- Without docker:
- Make sure to have python installed, here is a link to the official website:
- https://www.python.org/downloads/
- Rename the .env.example to .env.
- Modify the .env file to have your database info and secret key.
- Create a virutal environment for your system using the below link: https://docs.python.org/3/library/venv.html
- python -m venv venv
- Source the venv:
-
Windows:
-
Cmd: venv\Scripts\activate.bat
-
Powershell: venv\Scripts\Activate.ps1
-
Linux:
-
Bash/zsh: source venv\Scripts\activate
-
Install the requirements: pip install -r requirements.txt
-
Run the Flask Project: waitress-serve --port <port> flask_web:app
-
With Docker:
-
Make sure to install docker, here is a link to the official download page:
- First rename the .env.example to .env
- Modify the .env file to have your database info and secret key
- Then change the network and volumes in the docker-compose.yml
- To start: docker-compose up -d
This website has docker support.
I will be using mariadb for the website also, that won't run in a container.
This is running with the waitress WGSI Server.