Tools for creating and managing multi-site integrations like API Keys and Tokens.
Project description
Django Integrations
Tools for creating and managing multi-site integrations like API Keys and Tokens
Prerequisites
This pakcage makes use of Encrypted Fields that come form the django-fernet-fields packages. Make sure to checkout their documentation for any questions related to Field Encryption.
This package makes use of JSON fields so you'll need Download and install Postgresql. This will change with Django 3.1+ and the universal JSON field.
Installation
> pip install django-integration
For Developers
Make sure you run the following command to ensure you have all the requirements needed to us the develop example project:
pip install -e .[dev]
Then run the migration command inside the develop folder
./manage.py migrate
finally create a super user:
./manage.py createsuperuser
Example
In the develop django project you will find a core application that has three Forms each with its view to show case how to use the Credential Model in the integration package.
For example you have a ZoomForm to present the user with the fields Zoom gives to use their API with you project. The ZoomForm is responsible for presenting and validating the fields and linking it to the credentials Model just like a normal ModelForm would.
class ZoomForm(forms.ModelForm):
class Meta:
model = Credential
fields = ['public_key', 'private_key']
labels = {
'public_key': "Zoom Key",
'private_key': "Zoom Secret"
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['public_key'].required = True
self.fields['private_key'].required = True
It is in the view where it creates a Credential Model instance form the form submitted and saved. If you need to add additional fields or logic you can do it here, for example settting the site field in the Credential Model.
class ZoomFormView(FormView):
template_name = "core/form.html"
form_class = ZoomForm
success_url = reverse_lazy('integration-list')
def form_valid(self, form):
zoom = form.save(commit=False)
zoom.name = 'Zoom Integration'
zoom.site = Site.objects.get_current()
zoom.save()
return super().form_valid(form)
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
Built Distribution
File details
Details for the file django_integrations-0.2.0.tar.gz
.
File metadata
- Download URL: django_integrations-0.2.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
4e671737ecdd1c2d38942150207a2fd7358dca3b799b292372bfed5b5e7fb327
|
|
MD5 |
c452f91e7d1a3a832418566709bb6438
|
|
BLAKE2b-256 |
35af6ae53126638efddf684e19c4e250d11015459dee72fad28bd40c46e1451f
|
Provenance
The following attestation bundles were made for django_integrations-0.2.0.tar.gz
:
Publisher:
python-publish.yml
on renderbox/django-integrations
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
django_integrations-0.2.0.tar.gz
-
Subject digest:
4e671737ecdd1c2d38942150207a2fd7358dca3b799b292372bfed5b5e7fb327
- Sigstore transparency entry: 216065538
- Sigstore integration time:
-
Permalink:
renderbox/django-integrations@e84b35d7baeffa40d63da00e79328097f8e9e6e3
-
Branch / Tag:
refs/heads/main
- Owner: https://github.com/renderbox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-publish.yml@e84b35d7baeffa40d63da00e79328097f8e9e6e3
-
Trigger Event:
push
-
Statement type:
File details
Details for the file django_integrations-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: django_integrations-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5d94fce8df0ce4e9f20a4d8444bbcddc6de16a83555ce644eac2c11d4cb514ca
|
|
MD5 |
7e38e20e46416080ca0dcaf2932121e9
|
|
BLAKE2b-256 |
245b1354c6a144f8f1030c9c172d8d9093bc2e1cb38614d36245285f0a652ba7
|
Provenance
The following attestation bundles were made for django_integrations-0.2.0-py3-none-any.whl
:
Publisher:
python-publish.yml
on renderbox/django-integrations
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
django_integrations-0.2.0-py3-none-any.whl
-
Subject digest:
5d94fce8df0ce4e9f20a4d8444bbcddc6de16a83555ce644eac2c11d4cb514ca
- Sigstore transparency entry: 216065540
- Sigstore integration time:
-
Permalink:
renderbox/django-integrations@e84b35d7baeffa40d63da00e79328097f8e9e6e3
-
Branch / Tag:
refs/heads/main
- Owner: https://github.com/renderbox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-publish.yml@e84b35d7baeffa40d63da00e79328097f8e9e6e3
-
Trigger Event:
push
-
Statement type: