Permalink
Browse files

Added collectstatic to fab rebuild.

Creating media folder correctly now if none exists.
  • Loading branch information...
1 parent c2161a2 commit a6db934aff3140169cdacdd8f6ad3f8ca6a768c5 @mbrochh mbrochh committed Apr 7, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 website/webapps/django/myproject/fabfile/local.py
@@ -136,6 +136,7 @@ def rebuild():
"""
rebuild_db()
rebuild_media()
+ local('./manage.py collectstatic --noinput')
def rebuild_db():
@@ -155,10 +156,10 @@ def rebuild_db():
def rebuild_media():
"""Copies media fixtures into your media_root."""
- files_to_delete = os.path.join(MEDIA_ROOT, '*')
- local('rm -rf %s' % files_to_delete)
+ local('rm -rf %s' % MEDIA_ROOT)
media_fixtures_path = os.path.join(PROJECT_ROOT,
- 'test_media/fixtures/media/*')
+ 'test_media/fixtures/media/')
+ local('mkdir -p %s' % media_fixtures_path)
local('cp -rf %s %s' % (media_fixtures_path, MEDIA_ROOT))

0 comments on commit a6db934

Please sign in to comment.