Skip to main content

Django Form Survey

Django form survey is an application Django to easier create form survey and easy integrated for your project.

image

Table of content

Installation

  • Install django-form-surveys using:

    pip install django-form-surveys
    
    • Add djf_surveys to your INSTALLED_APPS setting like this
      INSTALLED_APPS = [
          ...
          'djf_surveys',
          'tinymce',  # dependency
      ]
      
  • Add context processor 'djf_surveys.context_processors.surveys_context'

    'context_processors': [
        ....
        'djf_surveys.context_processors.surveys_context'
    ],
    
  • Run python manage.py migrate to create the djf_surveys models.

  • Run python manage.py collectstatic to collect file static djf_surveys into project.

  • Include url djf_surveys in your root url

    ....
    
    urlpatterns = [
        path('admin/', admin.site.urls),
        .....
        path('surveys/', include('djf_surveys.urls'))
    ]
    
  • Access http://127.0.0.1:8000/surveys/dashboard/ to enter admin page to create a survey.

  • Access http://127.0.0.1:8000/surveys/ get list of survey

  • Access http://127.0.0.1:8000/surveys/{id} get form of survey

Features

Manage a Survey

You must as superuser to manage survey. You can create, edit, delete, search and show all available survey. To manage survey you can access http://localhost:8000/surveys/dashboard/. image

Option Survey

You can use the options below

  • editable: this option allows the user to edit the answer
  • deletable: this option allows the user to delete the answer
  • duplicate entry: this option allows users to submit more than once
  • private reponse: this option makes the answer list only visible to admin
  • can anonymous user: This option allows users without authentication to submit

Questioin Type

Available field types include: image

  • Text
  • Number
  • Radio
  • Select
  • Multi Select
  • Text Area
  • URL
  • Email
  • Date
  • Rating

Easy Sorting Question

You can drag and drop to sort question image

Summary

You can see the survey summary in a charts. Summary just calculate type field "radio, select, multi_select, rating" summary

Download Report

You can download report as csv

Notification

You can send an email notification when the survey is submitted. To make sure it works look section Configuration notification

Success Page Content

You can change the content of the success page to provide specific instructions or a special message. success_page success_page This use django-tinycme. For advanced config toolbar you can see the Documentation

Configuration

There are several configurations that you can write on settings.py

Change Master Template

SURVEY_MASTER_TEMPLATE, default='surveys/master.html', -> str: This configuration to change master template using your template. You can set with your template path. Example SURVEY_MASTER_TEMPLATE = 'mywebsite/master.html' > NB: This config will be work if on your template use block content {% block content %} to include or render content of context from view

and your master template must be including or using Tailwind CSS.

User Photo Profile

SURVEY_USER_PHOTO_PROFILE, default='', -> str: This configuration is used to add a profile photo object that is related to the User model. Example: SURVEY_USER_PHOTO_PROFILE = 'self.user.profile.photo.url'

Field Validators

SURVEY_FIELD_VALIDATORS, -> dict: This configuration to override max_length of type filed email, url, text and min_length of type filed text_area, text

# default value of SURVEY_FIELD_VALIDATORS
SURVEY_FIELD_VALIDATORS = {
    'max_length': {
        'email': 150,
        'text': 250,
        'url': 250,
        'text_area': 1000
    },
    'min_length': {
        'text_area': 100,
        'text': 3
    }
}
# example declare in settings.py
SURVEY_FIELD_VALIDATORS = {
    'max_length': {
        'email': 110,
    },
    'min_length': {
      'text_area': 50,
    }
}

Number of Pagination

SURVEY_PAGINATION_NUMBER, -> dict: This configuration to override number of pagination survey_list and answer_list

# example override in settings.py
# default value 12
SURVEY_PAGINATION_NUMBER = {
    'answer_list': 3,
    'survey_list': 2
}

Email From

Email From

SURVEY_EMAIL_FROM, -> str: Enter your email from and then don't forget to define your SMTP

Anonymous Access Surveys

SURVEY_ANONYMOUS_VIEW_LIST, -> bool: This configuration allows anonymous access to the survey page. The survey that appears has an Anonymous submission option.

SURVEY_LINK_BACK_ON_SUCCESS_PAGE -> str: This configuration is to change default link back on success page

For Contributor

  • clone project
  • symlink app to demo
    ln -s [path_project_djf_survey] [path_demo_djf_survey]
    
  • create env development
  • active env
  • enter directory demo
  • now, you can access all command manage.py

Metadata

Release files for django-form-surveys 2.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-form-surveys 2.5.0
File Size Uploaded
django_form_surveys-2.5.0.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-form-surveys 2.5.0
File Interpreter ABI Platform
django_form_surveys-2.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.2 MB

Release files / django_form_surveys-2.5.0.tar.gz

Download URL django_form_surveys-2.5.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
c9cd844859781a4e62fce0a03c56ff269449702eb7f27ae5da9237235492fcc6
BLAKE2b-256 checksum
How to use checksums
643c34271624866ddb9cd4151f901f35554842e770c7729fec6e9c9b6e186a67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.6

Release files / django_form_surveys-2.5.0-py3-none-any.whl

Download URL django_form_surveys-2.5.0-py3-none-any.whl
Size 1.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
bb1437773bef782565501379db12857fc187070a005737d34308f66021b4fd79
BLAKE2b-256 checksum
How to use checksums
13d2f4144cf1f28f48f79d3f6b0eb3b1be4ee1e0de241b03520bc43deadf7504
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.6

Release history Release notifications | RSS feed

This release

2.5.0 This release

2 release files

2.4.0

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.8.0

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1

2 release files

1.0

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page