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.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path("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.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path("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
File details
Details for the file django_simplefeedback-1.2.tar.gz
.
File metadata
- Download URL: django_simplefeedback-1.2.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cbaddba2674464a87221d222f42e1b49d2afea80a8efc6ebaa042316649089a |
|
MD5 | f9bf2f9d92f8001dbc2990309504b13d |
|
BLAKE2b-256 | e39c20dfaad14984bc0b2f2a63bef07cc0dabf751bad21c99ae4113c37c6bb23 |
File details
Details for the file django_simplefeedback-1.2-py3-none-any.whl
.
File metadata
- Download URL: django_simplefeedback-1.2-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 509e0b6b3be8fcab558951675b823b04cf614d3c33ca052b25966ea96b9eb4e8 |
|
MD5 | f9cac50a2b830367a387545e6494dd44 |
|
BLAKE2b-256 | aa7418d692d19a7c9218242ff60a700d55b802b8a299a952bf8ea7764c8c62bd |