Permalink
Browse files

Add command to generate metadata

  • Loading branch information...
1 parent fa9dd67 commit 8f7fe11bc02c7cadf6f531c064a560968dc2b003 @ericholscher ericholscher committed Mar 8, 2014
Showing with 21 additions and 0 deletions.
  1. +21 −0 readthedocs/core/management/commands/set_metadata.py
View
21 readthedocs/core/management/commands/set_metadata.py
@@ -0,0 +1,21 @@
+import logging
+from optparse import make_option
+
+from django.core.management.base import BaseCommand
+from django.conf import settings
+
+from projects import tasks
+from projects.models import Project
+
+log = logging.getLogger(__name__)
+
+
+class Command(BaseCommand):
+ def handle(self, *args, **options):
+ queryset = Project.objects.all()
+ for p in queryset:
+ log.info("Generating metadata for %s" % p)
+ try:
+ tasks.update_static_metadata(p.pk)
+ except Exception:
+ log.error('Build failed for %s' % p, exc_info=True)

0 comments on commit 8f7fe11

Please sign in to comment.