django-simplefeedback


Namedjango-simplefeedback JSON
Version 1.2.2 PyPI version JSON
download
home_page
SummaryA simple Django app to handle user tickets.
upload_time2023-10-17 12:03:56
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements django djangorestframework
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Installation

Install the pip package:

```bash
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

```python
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

```bash
python manage.py migrate
```

# Settings

`SIMPLE_FEEDBACK_NOTIFICATIONS_ENABLED`

default: `False`

It needs to be enabled explicitly in settings to send out emails.

`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:
```python
settings.py:
SIMPLE_FEEDBACK_SEND_MAIL_FUNC_OVERRIDE = send_email_function

def send_email_function(message, recipients):
    send_email()
```

# Develop

Clone the repo

```bash
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

```bash
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`

```python
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

```python
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`:

```python
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:

```bash
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
```

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


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "django-simplefeedback",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Zoltan Ilcsik <zi@pulilab.com>, Fekete Gyorgy <f@pulilab.com>",
    "download_url": "https://files.pythonhosted.org/packages/4e/ff/8d36c13a475f0aa68a3c5cde3e3df53c1cf4bb221feb0987319635ee3c09/django_simplefeedback-1.2.2.tar.gz",
    "platform": null,
    "description": "# Installation\n\nInstall the pip package:\n\n```bash\npip install django-simplefeedback\n```\n\nInstall `django-rest-framework` if not already installed\n\nadd `simple_feedback` and `rest_framework` to INSTALLED_APPS\n\ninclude 'simple_feedback.urls' into urlpatterns\n\n```python\nfrom django.urls import path, include\n\nurlpatterns = [\n    path('admin/', admin.site.urls),\n    path(\"api/\", include(\"simple_feedback.urls\")),\n]\n```\n\nMigrate the db to crate simple-feedback models\n\n```bash\npython manage.py migrate\n```\n\n# Settings\n\n`SIMPLE_FEEDBACK_NOTIFICATIONS_ENABLED`\n\ndefault: `False`\n\nIt needs to be enabled explicitly in settings to send out emails.\n\n`SIMPLE_FEEDBACK_SEND_TO` - email string or a list of email strings\n\nvalid examples:\n```\nSIMPLE_FEEDBACK_SEND_TO =\nSIMPLE_FEEDBACK_SEND_TO = 'sendto@address.org'\nSIMPLE_FEEDBACK_SEND_TO = ['sendto1@address.org', 'sendto2@address.org']\n```\nWhen SIMPLE_FEEDBACK_SEND_TO is empty or not defined, the email recepients will be all the superusers in the system.\n\n\n`SIMPLE_FEEDBACK_SEND_MAIL_FUNC_OVERRIDE` - function to send email with\nneeds to implement two kwargs `message` and `recipients`\n\nvalid example:\n```python\nsettings.py:\nSIMPLE_FEEDBACK_SEND_MAIL_FUNC_OVERRIDE = send_email_function\n\ndef send_email_function(message, recipients):\n    send_email()\n```\n\n# Develop\n\nClone the repo\n\n```bash\ngit clone git@github.com:pulilab/django-simple-feedback.git\n```\n\n## Test app\n\nTest standalone app:\n\n$ export DATABASE_URL='your_db'  # you can skip this, defaults to 'localhost' (use postgres.app for simplicity)\n\n$ pip install -r requirements.txt\n\n$ python runtests.py\n\n## Run the app in develop mode\n\nCreate a new django project and install the package in develop mode\n\n```bash\ndjango-admin startproject simple_feedback_demo\ncd simple_feedback_demo\npip install -e ~LOCAL_PATH_TO_DJANGO_SIMPLEFEEDBACK\n```\n\nAdd `simple_feedback` and `rest_framework` to `INSTALLED_APPS` in `settings.py`\n\n```python\nINSTALLED_APPS = [\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'django.contrib.messages',\n    'django.contrib.staticfiles',\n    'rest_framework',\n    'simple_feedback'\n]\n```\nConfigure demo app urls\n\n```python\nfrom django.urls import path, include\n\nurlpatterns = [\n    path('admin/', admin.site.urls),\n    path(\"api/\", include(\"simple_feedback.urls\")),\n]\n```\n> SqlLite is not supported\n\nChange the db config to use postgres in `settings.py`:\n\n```python\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql_psycopg2',\n        'NAME': 'postgres',\n        'USER': 'postgres',\n        'HOST': os.environ.get(\"DATABASE_URL\", 'localhost'),\n        'PORT': 5432,\n    }\n}\n```\n\nMigrate db, create super user and run your demo app:\n\n```bash\npython manage.py migrate\npython manage.py createsuperuser\npython manage.py runserver\n```\n\nopen the browser at `http://localhost:8000/admin`\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A simple Django app to handle user tickets.",
    "version": "1.2.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/pulilab/django-simple-feedback/issues",
        "Homepage": "https://github.com/pulilab/django-simple-feedback"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ea519a66a9b7da0328de65fde49bdbde8c404d96c132b78b24fc2eedcd14ba8a",
                "md5": "e0e9495e9a093683e3dd3d5cebdb29ac",
                "sha256": "c5946797586f6d8073c4309015661a43d8a29784c0c54e489132e3bba69372f1"
            },
            "downloads": -1,
            "filename": "django_simplefeedback-1.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e0e9495e9a093683e3dd3d5cebdb29ac",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 11039,
            "upload_time": "2023-10-17T12:03:52",
            "upload_time_iso_8601": "2023-10-17T12:03:52.832957Z",
            "url": "https://files.pythonhosted.org/packages/ea/51/9a66a9b7da0328de65fde49bdbde8c404d96c132b78b24fc2eedcd14ba8a/django_simplefeedback-1.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4eff8d36c13a475f0aa68a3c5cde3e3df53c1cf4bb221feb0987319635ee3c09",
                "md5": "8a980653e719e049212426aad043da9c",
                "sha256": "386362ca23e738a1e3ff97d26489c851129cc36cd89cad8ca9bc913e30b983d0"
            },
            "downloads": -1,
            "filename": "django_simplefeedback-1.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "8a980653e719e049212426aad043da9c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7145,
            "upload_time": "2023-10-17T12:03:56",
            "upload_time_iso_8601": "2023-10-17T12:03:56.522055Z",
            "url": "https://files.pythonhosted.org/packages/4e/ff/8d36c13a475f0aa68a3c5cde3e3df53c1cf4bb221feb0987319635ee3c09/django_simplefeedback-1.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-17 12:03:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pulilab",
    "github_project": "django-simple-feedback",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "django",
            "specs": []
        },
        {
            "name": "djangorestframework",
            "specs": []
        }
    ],
    "lcname": "django-simplefeedback"
}
        
Elapsed time: 0.22225s