Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More additions to the fabfile: a manage.py wrapper, and a command to …

…reset the community page.
  • Loading branch information...
commit 13719c4001dd1420ef55f02c565cdaaec7932f72 1 parent 1e21372
@jacobian jacobian authored
Showing with 17 additions and 5 deletions.
  1. +17 −5 fabfile.py
View
22 fabfile.py
@@ -50,15 +50,27 @@ def update_dependencies():
reqs = env.code_dir.child('deploy-requirements.txt')
sudo('%s -q install -r %s' % (pip, reqs))
-def _managepy(cmd, site='www'):
- """
- Helper: run a management command remotely.
+def reset_community():
"""
- django_admin = env.virtualenv.child('bin', 'django-admin.py')
+ Resets the community pages.
+ This is a temporary command that does some damage and it should be removed
+ once the new server's up.
+ """
+ _managepy('reset aggregator --noinput')
+ _managepy('loaddata community_seed')
def copy_db():
"""
Copy the production DB locally for testing.
"""
- local('ssh %s pg_dump -U djangoproject -c djangoproject | psql djangoproject' % env.hosts[0])
+ local('ssh %s pg_dump -U djangoproject -c djangoproject | psql djangoproject' % env.hosts[0])
+
+def _managepy(cmd, site='www'):
+ """
+ Helper: run a management command remotely.
+ """
+ assert site in ('docs', 'www')
+ django_admin = env.virtualenv.child('bin', 'django-admin.py')
+ sudo('%s %s --settings=django_website.settings.%s' % (django_admin, cmd, site))
+
Please sign in to comment.
Something went wrong with that request. Please try again.