Skip to main content
#+TITLE: Django GPG

[[https://travis-ci.org/arecker/reckerops][file:https://travis-ci.org/arecker/django-gpg.svg?branch=master]]

A GPG implementation for Django.

* Quick Start

1. Install the =django-gpg= package

#+BEGIN_SRC sh
git clone https://github.com/arecker/django-gpg.git && cd django-gpg
python setup.py install
#+END_SRC

2. Add "django_gpg" to your INSTALLED_APPS setting

#+BEGIN_SRC python
INSTALLED_APPS = [
# ...
'django_gpg',
]
#+END_SRC

3. Install [[https://www.gnupg.org/download/index.en.html][GnuPG]] on your system (e.g. =apt-get install gnupg=)

4. Run =python manage.py migrate= to create the new models

* Configuration

Include these settings in your =settings.py= to customize django-gpg.
Or just leave this out entirely to use the defaults shown here.

#+BEGIN_SRC python
django_gpg = {
# Require a public key for each user
'PUBLIC_KEY_REQUIRED': True
}
#+END_SRC

* Models

Each user will now have an associated GPG Profile. You can add public
keys via the django admin.

[[file:screenshots/admin.png]]

You can encrypt messages using the model method.

#+BEGIN_SRC python
friend = User.objects.first()
secret = me.gpgprofile.encrypt('HOOCHIE MAMA')
print(secret.split('\n'))
['-----BEGIN PGP MESSAGE-----',
'',
'hQIMA2DlyYO6tqUPARAAjOUCQZQR4TXwQhxa7x6BcrnGkrwu4iYk5T/6BqHce0Gu',
'81GBVwm04e2ptHO680y1jFqipdx8YLhP2wIjUurVDvEoLLOz/ILsFh8t3vvEGzJj',
'NN8GR/OqiYcf66Qr/FnfPvd1+KX0zRy3LC96ovGUp1SVGHvniAW8Er20sQ8lLOvs',
'MCGH7oIwhGcnE7CeR6RuqPNz2IKCquq6yV3wDffBiuglVAu21woh7FL3UIG2T/Sc',
'YM9Yn9PIY5P4fdVv3X+6f3LL7chbRmGtttw/9UYt4QgVDouUu5NR5H8ZZ1waqfbs',
'E0aMn93JYMIVEW3uICyNhfLMBbuJS/a/XGwCc18/j5n6Mst+PAljjQD70V9rCYqZ',
'LorX/3+lx02GSwdg6Yrz/0wndh2iDx7CEEn1vo0MSF6VV7stjhaOngRFFVhUlV2E',
'dPNZceVk8mqS/TUQL4Rvp8U6jTB+c8vA3ofS6nYl8AGH9Khd21VEIxzgCk2kkREN',
'Wknj3r6HUROAhewPrX+oGA/TFkiX1XSlOGP2fUnV09wCVJUPaIl0fWv6CcAH0gZ4',
'gQNeQnKZTMuRg++f7K+RkXIt9p1xkBd2c3kS24LVin6/G8lY6n68Y02GRJHvq1of',
'yNvhiufy+Tmu30dwmjPjB+9CnD4QCTvvI7ML3H1cJ62nCjSVKqa1M20+7p6urPrS',
'RwE7dQd3EInA55CBWJZ4HfPmqEnScwoBO4WC3xqL+CGXlI66L70+IebnVYDncTJX',
'6h58GjoXS4JJdghP48VZtG5TG+XOsYSs',
'=inGo',
'-----END PGP MESSAGE-----',
'']
#+END_SRC

Use queryset methods to encrypt a message for multiple users.

#+BEGIN_SRC python
from django_gpg.models import GpgProfile
message = GpgProfile.objects.filter(user=[...]).encrypt('hoochie mama')
#+END_SRC


Metadata

Release files for django-gpg 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for django-gpg 0.2.0
File Interpreter ABI Platform Actions
django_gpg-0.2.0-py2-none-any.whl Python 2 none any Details for django_gpg-0.2.0-py2-none-any.whl

Release files / django_gpg-0.2.0-py2-none-any.whl

Download URL django_gpg-0.2.0-py2-none-any.whl
Size 18.7 kB
Tags Python 2
SHA-256 checksum
How to use checksums
a0acecc724ad46f24845388d22e88093a08b133daa443c497941f93fe37d5fcb
BLAKE2b-256 checksum
How to use checksums
9b01184b76f0c6bee6e81b2682478d86529b18b2667e4b0b046d8a924e169e59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-gpg 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page