How pytition/pytition works
Project type and purpose
• Pytition is a monolithic, full-stack web application built with Django (Python) to let organizations host privacy-focused petition sites.
• It serves dynamic petition pages, dashboards, registration flows, signature exports, email confirmations and integrates with external SMTP and mailing-list endpoints.
File structure
• Top-level
– Dockerfile, docker-compose.yml, nginx-uwsgi/ (Nginx + uWSGI setup), Jenkinsfile → containerized CI/CD + deployment
– dev/ (shell scripts for local setup, prepopulation, Docker config)
– doc/ & .readthedocs.yaml → Sphinx documentation and ReadTheDocs integration
– pyproject.toml, requirements*.txt, pdm.lock → Python packaging and dependencies
• Core code under pytition/
– pytition/settings, urls.py, wsgi.py → Django project configuration
– petition/ → Django app with models, views, forms, management commands, templates, static assets, tests
– cli_pytition.py → custom CLI entry point
• Static assets and i18n
– petition/static/ (CSS, JS, vendor libs, manifest)
– petition/locale/ for multi-language support
• Tests, migrations and management commands illustrate custom background tasks (data generation, email queue, moderation, update jobs).
README for additional insights
• Technology stack: Django 4.2, Python 3.8–3.11, Bootstrap4, jQuery, TinyMCE, MySQL/PostgreSQL via mysqlclient, requests, bcrypt
• Features like email retry via queue middleware, Open Graph support, CSV export, mailing-list subscription integration
• Deployment targets: self-hosted, no third-party CDN, Dockerized setups