diff --git a/README.rst b/README.rst index 40e36b6..bc6cd3a 100644 --- a/README.rst +++ b/README.rst @@ -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 ============= diff --git a/request_token/migrations/0008_convert_token_data_to_jsonfield.py b/request_token/migrations/0008_convert_token_data_to_jsonfield.py index c261e18..8adc6f4 100644 --- a/request_token/migrations/0008_convert_token_data_to_jsonfield.py +++ b/request_token/migrations/0008_convert_token_data_to_jsonfield.py @@ -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', diff --git a/request_token/migrations/0012_auto_20180523_0513.py b/request_token/migrations/0012_auto_20180523_0513.py new file mode 100644 index 0000000..433e4f2 --- /dev/null +++ b/request_token/migrations/0012_auto_20180523_0513.py @@ -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), + ), + ] diff --git a/request_token/models.py b/request_token/models.py index fc7789b..91df0bf 100644 --- a/request_token/models.py +++ b/request_token/models.py @@ -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 diff --git a/requirements.txt b/requirements.txt index 9695d63..e0a1777 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ Django PyJWT sqlparse -psycopg2 \ No newline at end of file +psycopg2 +jsonfield diff --git a/setup.py b/setup.py index babd040..6f68321 100644 --- a/setup.py +++ b/setup.py @@ -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.', diff --git a/tox.ini b/tox.ini index 95a014f..c57c5bf 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,7 @@ deps = coverage==4.2 django111: Django==1.11 django20: Django==2.0 + jsonfield==2.0.2 commands = python --version