A Flask application template with the boilerplate code already done for you.
Documentation available at 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
- Redis Queue for handling asynchronous tasks
- ZXCVBN password strength checker
- CKEditor for editing pages
Home Page:
Registering User:
Admin Editing Page:
Admin Editing Users:
Navigate to the main project page and click the big, green "Use this template" button at the top right of the page. Give your new repository a name and save it.
$ git clone https://github.com/YOUR_USERNAME/REPO_NAME.git
$ cd REPO_NAME
Windows:
$ python3 -m venv venv
$ venv\Scripts\activate.bat
Unix/MacOS:
$ python3 -m venv venv
$ source venv/bin/activate
Learn more in the documentation.
Note: if you are using a python before 3.3, it doesn't come with venv. Install virtualenv with pip instead.
$ xcode-select --install
$ pip install -r requirements.txt
You need 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 (based on this issue):
sudo apt-get install libpq-dev
$ python3 manage.py recreate_db
$ python3 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.
$ python3 manage.py add_fake_data
$ source env/bin/activate
$ python3 manage.py runserver
Use the command below instead of $ python3 manage.py runserver
if your code utilizes variables within the config.env file.
$ honcho start -e config.env -f Local
For Windows users having issues with binding to a redis port locally, refer to this issue.
Before you submit changes to flask-base, you may want to autoformat your code with python manage.py format
.
Contributions are welcome! 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.