From 18b2fbfb06d0848b51b047a10cf10839853c3cf9 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sun, 15 Nov 2020 16:08:22 -0500 Subject: added site build var to pages app --- app/builder/base.py | 5 ++++- app/builder/views.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'app/builder') diff --git a/app/builder/base.py b/app/builder/base.py index fabea6e..04a92ce 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -1,6 +1,7 @@ import os from math import ceil from decimal import Decimal +from django.contrib.sites.models import Site from django.test.client import Client from django.template.loader import render_to_string from django.template import Context @@ -33,7 +34,9 @@ class _FileWriter(object): class BuildNew(): - def __init__(self, model, app): + + def __init__(self, model, app, site=1): + self.site = Site.objects.get(domain=site) self.model = apps.get_model(model, app) self.get_model_queryset() self.client = Client() diff --git a/app/builder/views.py b/app/builder/views.py index 97ca30a..7804630 100644 --- a/app/builder/views.py +++ b/app/builder/views.py @@ -37,7 +37,7 @@ def do_build(request): BuildGuide("posts", "post").build() elif section == 'pages': context = {'message': 'Writing Pages to Disk'} - BuildPages("pages", "page").build() + BuildPages("pages", "page", 'luxagraf.net').build() elif section == 'fieldnotes': context = {'message': 'Writing FieldNotes to Disk'} BuildFieldNotes("posts", "post").build() -- cgit v1.2.3-70-g09d2