Skip to content
Newer
Older
100644 37 lines (25 sloc) 960 Bytes
e0699d8 @jbalogh releasing test-utils from the clutches of zamboni
jbalogh authored Feb 9, 2010
1 """
2 Creating standalone Django apps is a PITA because you're not in a project, so
3 you don't have a settings.py file. I can never remember to define
4 DJANGO_SETTINGS_MODULE, so I run these commands which get the right env
5 automatically.
6 """
7 import functools
8 import os
9
10 from fabric.api import local, cd, env
11 from fabric.contrib.project import rsync_project
12
13 NAME = os.path.basename(os.path.dirname(__file__))
e8a1205 @jbalogh helper file updates
jbalogh authored Feb 18, 2010
14 ROOT = os.path.abspath(os.path.dirname(__file__))
e0699d8 @jbalogh releasing test-utils from the clutches of zamboni
jbalogh authored Feb 9, 2010
15
e8a1205 @jbalogh helper file updates
jbalogh authored Feb 19, 2010
16 os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % NAME
17 os.environ['PYTHONPATH'] = os.pathsep.join([ROOT,
18 os.path.join(ROOT, 'examples')])
e0699d8 @jbalogh releasing test-utils from the clutches of zamboni
jbalogh authored Feb 9, 2010
19
20 env.hosts = ['jbalogh.me']
21
22 local = functools.partial(local, capture=False)
23
24
25 def doc(kind='html'):
26 with cd('docs'):
27 local('make clean %s' % kind)
28
29
30 def test():
e8a1205 @jbalogh helper file updates
jbalogh authored Feb 19, 2010
31 local('django-admin.py test -s')
e0699d8 @jbalogh releasing test-utils from the clutches of zamboni
jbalogh authored Feb 9, 2010
32
33
34 def updoc():
35 doc('dirhtml')
36 rsync_project('p/%s' % NAME, 'docs/_build/dirhtml/', delete=True)
Something went wrong with that request. Please try again.