Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
initial swing at template task. For #89
Browse files Browse the repository at this point in the history
  • Loading branch information
aboutaaron committed Apr 1, 2015
1 parent 33344a6 commit 9a1e890
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions fabfile/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ def sh():
local('python manage.py shell_plus')


@task
def template(template_name='template.html'):
"""
Generate a template that inherits from 'base.html'
Optionally pass template file name. Defaults to 'template.html'
"""
template = """
{% extends 'base.html' %}
{% load staticfiles %}
{% block content %}
{% endblock %}
"""
template_dir = os.path.join(settings.BASE_DIR, 'templates')
os.path.exists(template_dir) or os.mkdir(template_dir)

local("echo {} >> {}/{}".format(template, template_dir, template_name))


@task
def startapp(app_name):
"""
Expand Down

0 comments on commit 9a1e890

Please sign in to comment.