From e19ddd99763195dc2829158d9891113aa9aed40c Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 9 Sep 2015 21:20:39 -0700 Subject: [PATCH] Add urls and clean commands to manage.py Two new useful commands for manage.py. `m urls` lists all URLs (like `rake routes` in Rails). `m clean` gets rid of .pyc files. --- {{cookiecutter.app_name}}/manage.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.app_name}}/manage.py b/{{cookiecutter.app_name}}/manage.py index 6abed9e..ed8ad09 100644 --- a/{{cookiecutter.app_name}}/manage.py +++ b/{{cookiecutter.app_name}}/manage.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import os from flask_script import Manager, Shell, Server +from flask_script.commands import Clean, ShowUrls from flask_migrate import MigrateCommand from {{cookiecutter.app_name}}.app import create_app @@ -38,6 +39,8 @@ def test(): manager.add_command('server', Server()) manager.add_command('shell', Shell(make_context=_make_context)) manager.add_command('db', MigrateCommand) +manager.add_command("urls", ShowUrls()) +manager.add_command("clean", Clean()) if __name__ == '__main__': manager.run()