This code is a template for the back-end framework Flask and the front-end framework Bulma.
It is based on YouTuber Corey Schafer's Flask series. It also does NOT follow the application factory pattern; in my opinion, it is better this way.
This template is well-organized and is split into folders and files which contain code for specific uses.
- Accounts
- Login
- Log out
- Confirmation emails
- Password reset
- Simple database models
- Simple forms
- Clone the repository by running
git clone https://github.com/vishnupsatish/flask-bulma-template
- Change the name of the directory to your project name by running
mv flask-bulma-template [new_name]
- Go to the directory by running
cd flask-bulma-template
- Ensure you have Python and virtualenv installed
- Create a new virtual environment with the name
venv
by runningvirtualenv venv
orpython3 -m virtualenv venv
- Install the required Python modules by running
pip install -r requirements.txt
- Set
DATABASE_URL
tosqlite:///site.db
if you want to use SQLite- If you're not using SQLite, set it to your database's URL
- Change all "placeholder" values to custom values (Ctrl+F "placeholder", non-case-sensitive, make sure not to change anything in
application/forms
)- This includes your secret key, email username, email password, etc. for sending confirmation and password reset emails
- Run the Flask application by running
python3 run.py
- In a browser, go to
http://localhost:5000
- If needed, in
run.py
, changedebug=False
todebug=True
to enable auto-reload
Note: if you are using Windows you may need to replace python3
with python