Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend database support #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Django Request Token

Django app that uses JWT to manage one-time and expiring tokens to protect URLs.

This app currently requires the use of PostgreSQL.

Compatibility
=============

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ class Migration(migrations.Migration):
]

operations = [
migrations.AlterField(
model_name='requesttoken',
name='data',
field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default={}, help_text='Custom data add to the token, but not encoded (must be fetched from DB).', null=True),
),
migrations.AlterField(
model_name='requesttokenlog',
name='token',
Expand Down
19 changes: 19 additions & 0 deletions request_token/migrations/0012_auto_20180523_0513.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 2.0.5 on 2018-05-23 05:13

from django.db import migrations
import jsonfield.fields


class Migration(migrations.Migration):

dependencies = [
('request_token', '0011_update_model_meta_options'),
]

operations = [
migrations.AlterField(
model_name='requesttoken',
name='data',
field=jsonfield.fields.JSONField(blank=True, default={}, help_text='Custom data add to the token, but not encoded (must be fetched from DB).', null=True),
),
]
2 changes: 1 addition & 1 deletion request_token/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

from django.conf import settings
from django.contrib.auth import login
from django.contrib.postgres.fields import JSONField
from django.core.exceptions import ValidationError
from django.db import models, transaction
from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now as tz_now

from jsonfield import JSONField
from jwt.exceptions import InvalidAudienceError

from .exceptions import MaxUseError
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
Django
PyJWT
sqlparse
psycopg2
psycopg2
jsonfield
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
'Django>=1.11',
'PyJWT>=1.4',
'sqlparse>=0.2',
'psycopg2>=2.7'
'psycopg2>=2.7',
'jsonfield>=2.0.2'
],
include_package_data=True,
description='JWT-backed Django app for managing querystring tokens.',
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ deps =
coverage==4.2
django111: Django==1.11
django20: Django==2.0
jsonfield==2.0.2

commands =
python --version
Expand Down