summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/builder/base.py6
-rw-r--r--app/builder/views.py3
2 files changed, 7 insertions, 2 deletions
diff --git a/app/builder/base.py b/app/builder/base.py
index 04a92ce..7b99c58 100644
--- a/app/builder/base.py
+++ b/app/builder/base.py
@@ -15,7 +15,9 @@ class _FileWriter(object):
"""
Given a path and text object; write the page to disc
"""
- def __init__(self, path, text_object, ext='html', filename='index', base_path=settings.FLATFILES_ROOT):
+ def __init__(self, path, text_object, ext='html', filename='index', site='luxagraf.net'):
+ site = Site.objects.get(domain=site)
+ base_path = os.path.join(settings.PROJ_ROOT, site.domain)
self.path = '%s%s' % (base_path, path)
if not os.path.isdir(self.path):
os.makedirs(self.path)
@@ -49,7 +51,7 @@ class BuildNew():
return self.model.objects.filter(status__exact=1)
def write_file(self, path, text_object, ext='html', filename='index'):
- self.writer = _FileWriter(path, text_object, ext=ext, filename=filename)
+ self.writer = _FileWriter(path, text_object, ext=ext, filename=filename, site=self.site)
def get_pages(self, qs, paginate_by):
return int(ceil(Decimal(qs.count()) / Decimal(paginate_by)))
diff --git a/app/builder/views.py b/app/builder/views.py
index 7804630..5988e1f 100644
--- a/app/builder/views.py
+++ b/app/builder/views.py
@@ -68,6 +68,9 @@ def do_build(request):
elif section == 'dailyphotos':
context = {'message': 'Writing daily photo pages to Disk'}
dailybuilder()
+ elif section == 'discursivepages':
+ context = {'message': 'Writing Discursive Meditation Pages to Disk'}
+ BuildPages("pages", "page", 'discursivemeditation.com').build()
return render(request, 'admin/message.html', context)