{% load static %} Survey Studio Docs

Documentation

Survey Studio Docs

This service ships with a Django admin builder and public JSON endpoints for rendering published surveys and receiving responses.

Setup

python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

Admin Workflow

  1. Create a survey at /admin/.
  2. Add questions inline on the survey page.
  3. Add choices to single-choice and multiple-choice questions.
  4. Set the survey status to Published.

Public API

GET /api/surveys/

List published surveys.

GET /api/surveys/<slug>/

Read the survey schema with questions and choices.

POST /api/surveys/<slug>/responses/

Submit an anonymous response.

Answer Formats

{
  "respondent_email": "person@example.com",
  "metadata": {
    "source": "website"
  },
  "answers": [
    {
      "question": "name",
      "value": "Alex"
    },
    {
      "question": "experience",
      "choice": "good"
    }
  ]
}

Answers can also be sent as an object keyed by question slug. Choice answers accept either the choice value or choice id.

Configuration

  • DJANGO_SECRET_KEY: required for production.
  • DJANGO_DEBUG: set to 0 in production.
  • DJANGO_ALLOWED_HOSTS: comma-separated host list.
  • SURVEY_API_CORS_ORIGINS: comma-separated origin list for /api/.