added help message for django.startapp

This commit is contained in:
Ronny Abraham 2017-11-09 00:33:30 +02:00
parent cb0eff3c4e
commit 2237dd4856

View file

@ -129,23 +129,35 @@ def run(args=None):
@task
def startapp(args):
def startapp(appname='help'):
"""
wrapper for the django.startapp
takes name of app and creates in in code/apps
args - name of app
appname - name of app
"""
configuration = env.config
destination = os.path.join(configuration.paths.django.apps, args)
msg_help = """
django.startapp takes one of two values:
\thelp - this help message
\tappname - the name of the app you want to start
"""
from utils import handle_help
import sys
if handle_help(appname, msg_help, 'help'):
sys.exit()
destination = os.path.join(configuration.paths.django.apps, appname)
cmd_mkdir = "mkdir {destination}".format(
destination=destination)
command = "startapp {appname} {destination}".format(
appname=args,
appname=appname,
destination=destination)
fabric_ops.run(cmd_mkdir)