A Django wrapper for Replyify’s Python API bindings.
Installation
You can install this package by using the pip tool and installing:
$ pip install django-replyify-oauth2
Or:
$ easy_install django-replyify-oauth2
Register Your Application with Replyify
Sign up for Replyify at https://app.replyify.com/access/signup
Register your application at https://app.replyify.com/oauth2/applications/register
Supported OAuth2 configuration is Public / Authorization code.
Configure the django-replyify-oauth2 module
From your previously configured app, found at https://app.replyify.com/oauth2/applications add the following to your Django settings.py:
REPLYIFY_CLIENT_ID = '{ update me }'
REPLYIFY_CLIENT_SECRET = '{ update me }'
REPLYIFY_REDIRECT_URI = '{ update me, must match value set from previous step'
REPLYIFY_USER_ID_FIELD = 'id' # or other primary key user field like `guid`
REPLYIFY_DENIED_REDIRECT = '/path/when/user/denies/access' # defaults to home page
INSTALLED_APPS = [
...
'replyify_oauth2',
...
]
And add the following to your urls.py
from django.urls import include, re_path
urlpatterns = [
...
re_path(r'^replyify/', include(('replyify_oauth2.urls', 'replyify_oauth2'), namespace='replyify')),
...
]
Run migrate
**$ python manage.py migrate**
In templates
<a href="{% url 'replyify:authorize' %}?next={% url 'home'|urlencode %}">Connect to Replyify</a>
Note: you can pass next query parameter to the authorize view to direct the user to correct page after OAuth flow has completed successfully. Default will send user to ‘/’
In views as a decorator: this will kick off the Authorization flow or Refresh request (if token is expired) and will send the user back to the original requested url on completion
from replyify_oauth2.decorators import replyify_auth_required
@replyify_auth_required
def my_view_that_needs_replyify(request):
...
Using the Replyify API
Documentation for the python bindings can be found here:
In the standard documentation (the first link), most of the reference pages will have examples in Replyify’s official bindings (including Python). Just click on the Python tab to get the relevant documentation.
In the full API reference for python (the second link), the right half of the page will provide example requests and responses for various API calls.
Metadata
Release files for django-replyify-oauth2 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_replyify_oauth2-0.3.0.tar.gz | 7.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_replyify_oauth2-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / django_replyify_oauth2-0.3.0.tar.gz
| Download URL | django_replyify_oauth2-0.3.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f96e945ea31c1367d991180c43408fc4cac97a8f13f0f77984ae145ab81939da
|
|
BLAKE2b-256 checksum How to use checksums |
f4de81047d45512737b88ef1b34ba5e31af1970cb5effd99abf165ceb535d08b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.10
|
Release files / django_replyify_oauth2-0.3.0-py3-none-any.whl
| Download URL | django_replyify_oauth2-0.3.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20301af58b318cf058a8df3bababeaf36b6bc8cb53460a4dc36d7247b754aafd
|
|
BLAKE2b-256 checksum How to use checksums |
b572ce6d0605740787de8a2cf5b86efdbc70219418d4e55b3a4d7a16f91afc08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.10
|