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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_simplefeedback-1.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 414aab99b3ce8503fc7ca96cb6c09dd823a875e87e9a30620e807a9a1643ae33 |
|
MD5 | c5344ba1dd7d27f3fefc10e1d3e352bc |
|
BLAKE2b-256 | 1e974d4896dd700a8fc8089f363e4e23f5f8b2ac7c22f4441ca5f3c6ff119590 |
Hashes for django_simplefeedback-1.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da1b0990463e84222e29b6be172fd6a979b0110044a4c10c3926f0babd3bb316 |
|
MD5 | 2a99d53970c07c16c8b5f865b8bee356 |
|
BLAKE2b-256 | a69034aa0716b1a76a70db6bc06f792bf1149f7763f7f7b0cfe8b0b240bb645c |