A Flask application template with the boilerplate code already done for you.
Adapted from the Team @ Hack4Impact https://github.com/hack4impact/flask-base http://hack4impact.github.io/flask-base
- Blueprints
- User and permissions management
- Flask-SQLAlchemy for databases
- Flask-WTF for forms
- Flask-Assets for asset management and SCSS compilation
- Flask-Mail for sending emails
- gzip compression
- Celery + Redis for handling asynchronous tasks
- ZXCVBN password strength checker
- CKEditor for editing pages
Home Page:
Registering User:
Admin Homepage:
Admin Editing Page:
Admin Editing Users:
Admin Adding a User:
$ git clone https://github.com/tobymccann/flask-base.git
$ cd flask-base
$ python3 -m venv env
$ source env/bin/activate
$ xcode-select --install
Create a file called config.env
that contains environment variables in the following syntax: ENVIRONMENT_VARIABLE=value
. For example,
the mailing environment variables can be set as the following. Any mail service should work.
MAIL_USERNAME=EmailUsername
MAIL_PASSWORD=EmailPassword
SECRET_KEY=SuperRandomStringToBeUsedForEncryption
Note: do not include the config.env
file in any commits. This should remain private.
$ pip install -r requirements.txt
You need to install Redis, and Sass. Chances are, these commands will work:
Sass:
$ gem install sass
Redis:
Mac (using homebrew):
$ brew install redis
Linux:
$ sudo apt-get install redis-server
You will also need to install PostgresQL
Mac (using homebrew):
brew install postgresql
Linux:
sudo apt-get install libpq-dev
$ python manage.py recreate_db
$ python manage.py setup_dev
Note that this will create an admin user with email and password specified by the ADMIN_EMAIL
and ADMIN_PASSWORD
config variables. If not specified, they are both [email protected]
and password
respectively.
$ python manage.py add_fake_data
$ source env/bin/activate
$ honcho start -f Local
Before you submit changes to flask-base, you may want to auto format your code with python manage.py format
.
Contributions are welcome! Check out our Waffle board which automatically syncs with this project's GitHub issues. Please refer to our Code of Conduct for more information.
To make changes to the documentation refer to the Mkdocs documentation for setup.
To create a new documentation page, add a file to the docs/
directory and edit mkdocs.yml
to reference the file.
When the new files are merged into master
and pushed to github. Run mkdocs gh-deploy
to update the online documentation.