Populate the client website template with catalog feature flags.

Extract always-on public/portal/UTM plus optional email_sms, directmail, blog, payments, social, and social_ai so new client sites can be bootstrapped from this seed.

Refs #1
Refs #2

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-26 07:55:26 -05:00
co-authored by Cursor
parent 45d0888d33
commit 787f0e48fb
297 changed files with 32534 additions and 3 deletions
+27
View File
@@ -0,0 +1,27 @@
import json
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.views.decorators.http import require_POST
from social_ai.ollama import OllamaError, generate_social_post
@login_required
@require_POST
def api_generate(request):
"""JSON endpoint to draft posts via Ollama. POST JSON: prompt, platform."""
try:
payload = json.loads(request.body.decode() or "{}")
except json.JSONDecodeError:
payload = request.POST.dict()
prompt = (payload.get("prompt") or "").strip()
if not prompt:
return JsonResponse({"error": "prompt required"}, status=400)
try:
text = generate_social_post(
prompt, platform=(payload.get("platform") or "").strip()
)
except OllamaError as exc:
return JsonResponse({"error": str(exc)}, status=502)
return JsonResponse({"text": text})