forked from mtigas/django-medusa
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optional hooks for before and after the rendering loop.
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
from django.core.management.base import BaseCommand, CommandError | ||
from django.core.management.base import BaseCommand | ||
from django_medusa.renderers import StaticSiteRenderer | ||
from django_medusa.utils import get_static_renderers | ||
|
||
|
||
class Command(BaseCommand): | ||
can_import_settings = True | ||
|
||
help = 'Looks for \'renderers.py\' in each INSTALLED_APP, which defines '\ | ||
'a class for processing one or more URL paths into static files.' | ||
|
||
def handle(self, *args, **options): | ||
StaticSiteRenderer.initialize_output() | ||
|
||
for Renderer in get_static_renderers(): | ||
r = Renderer() | ||
r.generate() | ||
|
||
StaticSiteRenderer.finalize_output() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters