The django-survey project is an application for Django that makes it easy to create and manage surveys on websites. This application provides functionalities to create surveys, define questions and response options, manage active and inactive surveys, collect user responses, and generate statistical reports on survey results. With this tool, developers can easily integrate surveys into their Django websites to collect user data and feedback.
pip install django-surveyplus
# settings.py
INSTALLED_APPS = [
# ...
'survey',
# ...
]
urlpatterns = [
# ...
path('survey/', include('survey.urls')),
# ...
]
python manage.py migrate
from survey.models import Survey, SurveyOption
survey = Survey.objects.create(
title='Test Survey',
description='Survey Description',
)
for i in range(1, 5):
SurveyOption.objects.create(
survey=survey,
title=f'Option {i}',
description=f'Option {i} Description',
)
{% load survey %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Survey</title>
</head>
<body>
<!-- Assuming you have a survey object -->
{% survey_detail survey %}
</body>
</html>
-
Clone the repository:
git clone https://github.com/wilmerm/django-survey.git cd django-survey
-
Create and activate a virtual environment:
python -m venv env source env/bin/activate # On Windows use `env\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt
-
Build and install the survey application:
python -m build pip uninstall django-surveyplus pip install dist/*tar.gz
-
Run the development server:
python manage.py runserver
To run the tests, use the following command:
python manage.py test
To compile and upload the library to PyPI, follow these steps:
-
Ensure you have the necessary dependencies:
pip install build twine
-
Build the package:
python -m build
-
(Optional) Verify the package:
twine check dist/*
-
Upload the package to PyPI:
python -m twine upload dist/*
This project is licensed under the MIT License. See LICENSE file for details.
This project is in Production/Stable ✔
If you find value in this project and would like to show your support, please consider making a donation via PayPal:
Your generosity helps us to continue improving and maintaining this project. We appreciate every contribution, however small. Thanks for being part of our community!