Skip to content

cookiecutter template for Wikimedia Toolforge tools using Flask

License

Notifications You must be signed in to change notification settings

Abbe98/cookiecutter-toolforge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cookiecutter-toolforge

A cookiecutter template for Wikimedia Toolforge tools using the Flask Python framework.

Usage

Install cookiecutter if it’s not already installed on your system. If it’s not available in your package manager, the following command should work:

sudo pip install cookiecutter

Once cookiecutter is installed, you can create a new tool project with the following command:

cookiecutter gh:lucaswerkmeister/cookiecutter-toolforge

You will be prompted for some metadata about the tool, and then the resulting source code will be placed into a directory named after the tool’s identifier (the first thing you were asked for). Change into that directory, install dependencies and run the tool locally:

cd <tool_identifier>
pip install -r requirements.txt
FLASK_ENV=development FLASK_APP=app.py flask run

Then, open http://localhost:5000/ and follow the further instructions there.

Features

The full list of features is on the tool’s default index page once you follow the instructions above, but in brief, this template includes:

  • A basic HTML template, using Bootstrap v4.0.
  • Examples of Flask routing and templating.
  • Form handling, including CSRF protection.
  • Authentication against Wikimedia sites using OAuth.
  • Optionally, automated code style (Flake8), type (mypy) and functionality (pytest) checks.

screenshot

License

This template is released under the MIT license, as provided in the LICENSE file that accompanies it. By contributing to the repository, you agree to license your contribution under this license.

Generated projects (tools) use the GNU AGPL v3 by default, but you are free to choose any license you want, and no formal attribution to this template is required (though some form of attribution is still appreciated). In terms of the license, projects are not considered “substantial portions of the Software” (i. e. the template).

About

cookiecutter template for Wikimedia Toolforge tools using Flask

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 55.6%
  • Python 43.7%
  • Makefile 0.7%