Skip to main content

A simple Django app to handle user tickets.

Project description

Installation

Install the pip package:

pip install django-simplefeedback

Install django-rest-framework if not already installed

add simple-feedback and rest_framework to INSTALLED_APPS

include 'simple-feedback.urls' into urlpatterns

from django.conf.urls import url, include
from django.contrib import admin

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r"^api/", include("simple_feedback.urls")),
]

Migrate the db to crate simple-feedback models

python manage.py migrate

Settings

SIMPLE_FEEDBACK_SEND_TO - email string or a list of email strings

valid examples:

SIMPLE_FEEDBACK_SEND_TO =
SIMPLE_FEEDBACK_SEND_TO = 'sendto@address.org'
SIMPLE_FEEDBACK_SEND_TO = ['sendto1@address.org', 'sendto2@address.org']

When SIMPLE_FEEDBACK_SEND_TO is empty or not defined, the email recepients will be all the superusers in the system.

SIMPLE_FEEDBACK_SEND_MAIL_FUNC_OVERRIDE - function to send email with needs to implement two kwargs message and recipients

valid example:

settings.py:
SIMPLE_FEEDBACK_SEND_MAIL_FUNC_OVERRIDE = send_email_function

def send_email_function(message, recipients):
    send_email()

Develop

Clone the repo

git clone git@github.com:pulilab/django-simple-feedback.git

Test app

Test standalone app:

$ export DATABASE_URL='your_db' # you can skip this, defaults to 'localhost' (use postgres.app for simplicity)

$ pip install -r requirements.txt

$ python runtests.py

Run the app in develop mode

Create a new django project and install the package in develop mode

django-admin startproject simple_feedback_demo
cd simple_feedback_demo
pip install -e ~LOCAL_PATH_TO_DJANGO_SIMPLEFEEDBACK

Add simple-feedback and rest_framework to INSTALLED_APPS in settings.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework',
    'simple_feedback'
]

Configure demo app urls

from django.conf.urls import url, include
from django.contrib import admin

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r"^api/", include("simple_feedback.urls")),
]

SqlLite is not supported

Change the db config to use postgres in settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'postgres',
        'USER': 'postgres',
        'HOST': os.environ.get("DATABASE_URL", 'localhost'),
        'PORT': 5432,
    }
}

Migrate db, create super user and run your demo app:

python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

open the browser at http://localhost:8000/admin

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_simplefeedback-1.0.8.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

django_simplefeedback-1.0.8-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file django_simplefeedback-1.0.8.tar.gz.

File metadata

  • Download URL: django_simplefeedback-1.0.8.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for django_simplefeedback-1.0.8.tar.gz
Algorithm Hash digest
SHA256 7dc2773d793a39ed2554760644dfa2a4f1a91f90e9e6847923c0054580688f73
MD5 cfedefb6e69793d3e37bc69718fb0b01
BLAKE2b-256 fe6adb23d571cdeb5fa559b5fe0d9ec956293593052c1653203dd09d685a2dd1

See more details on using hashes here.

File details

Details for the file django_simplefeedback-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for django_simplefeedback-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5220e8001230e1eaaba969cdf948f78b65e8221ee2c8d7b8135f4008770f8f0c
MD5 7920e1828ef8bb89df099a1ea3769554
BLAKE2b-256 6cc76623e7d42d6ec691b78364e4fbd989afabf33078dbc06001c00de7a2681a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page