Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-django-qsessions for openSUSE:Factory checked in at 2021-12-26 13:30:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-qsessions (Old) and /work/SRC/openSUSE:Factory/.python-django-qsessions.new.2520 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-qsessions" Sun Dec 26 13:30:37 2021 rev:2 rq:942588 version:1.1.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-qsessions/python-django-qsessions.changes 2020-09-15 16:30:02.850697737 +0200 +++ /work/SRC/openSUSE:Factory/.python-django-qsessions.new.2520/python-django-qsessions.changes 2021-12-26 13:30:57.218978077 +0100 @@ -1,0 +2,9 @@ +Sun Dec 26 10:51:14 UTC 2021 - John Vandenberg <jay...@gmail.com> + +- Update to v1.1.3 + * Add django 4.0 support. + * Remove django 1.11, 2.0, 2.1 support. +- from v1.1.2 + * Use gettext_lazy instead of ugettext_lazy + +------------------------------------------------------------------- Old: ---- django-qsessions-1.1.1.tar.gz New: ---- django-qsessions-1.1.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-qsessions.spec ++++++ --- /var/tmp/diff_new_pack.s9Ueso/_old 2021-12-26 13:30:57.662978386 +0100 +++ /var/tmp/diff_new_pack.s9Ueso/_new 2021-12-26 13:30:57.666978388 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-django-qsessions # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-django-qsessions -Version: 1.1.1 +Version: 1.1.3 Release: 0 Summary: Extended session backends for Django License: MIT ++++++ django-qsessions-1.1.1.tar.gz -> django-qsessions-1.1.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/CHANGELOG.md new/django-qsessions-1.1.3/CHANGELOG.md --- old/django-qsessions-1.1.1/CHANGELOG.md 2020-09-10 08:21:20.000000000 +0200 +++ new/django-qsessions-1.1.3/CHANGELOG.md 2021-12-24 10:10:53.000000000 +0100 @@ -1,3 +1,14 @@ +# 1.1.3 (Dec 24, 2021) + +- Add django 4.0 support. +- Remove django 1.11, 2.0, 2.1 support. + +# 1.1.2 (Oct 17, 2020) + +- Use gettext_lazy instead of ugettext_lazy. + +Thanks [@akx](https://github.com/akx) + # 1.1.1 (Sep 10, 2020) - Set development status to Production/Stable in setup.py. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/LICENSE.txt new/django-qsessions-1.1.3/LICENSE.txt --- old/django-qsessions-1.1.1/LICENSE.txt 2018-01-20 16:09:43.000000000 +0100 +++ new/django-qsessions-1.1.3/LICENSE.txt 2021-12-24 10:10:53.000000000 +0100 @@ -17,4 +17,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/PKG-INFO new/django-qsessions-1.1.3/PKG-INFO --- old/django-qsessions-1.1.1/PKG-INFO 2020-09-10 08:25:19.882639200 +0200 +++ new/django-qsessions-1.1.3/PKG-INFO 2021-12-24 10:13:55.987334500 +0100 @@ -1,237 +1,20 @@ Metadata-Version: 2.1 Name: django-qsessions -Version: 1.1.1 +Version: 1.1.3 Summary: Extended session backends for Django Home-page: https://github.com/QueraTeam/django-qsessions Author: Mohammad Javad Naderi License: MIT Download-URL: https://pypi.python.org/pypi/django-qsessions -Description: .. image:: https://user-images.githubusercontent.com/2115303/35397912-f00efbb4-0205-11e8-89b5-3d4f585a4588.png - - .. image:: https://img.shields.io/pypi/v/django-qsessions.svg - :target: https://pypi.python.org/pypi/django-qsessions/ - - .. image:: https://img.shields.io/travis/QueraTeam/django-qsessions.svg - :target: https://travis-ci.org/QueraTeam/django-qsessions - - .. image:: https://img.shields.io/github/license/QueraTeam/django-qsessions.svg - :target: https://github.com/QueraTeam/django-qsessions/blob/master/LICENSE.txt - - .. image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black - - ------- - - **django-qsessions** offers two extended session backends for Django. - They extend Django's ``db`` and ``cached_db`` backends (and ``Session`` model) - with following extra features: - - - Sessions have a foreign key to User - - Sessions store IP and User Agent - - - Comparison - ========== - - Here is a brief comparison between Django's session backends (db, cache, cached_db), and django-qsessions. - - +-------------------------+-------------------------+----------------+ - | | django | qsessions | - + +-------+-----+-----------+----+-----------+ - | | cache | db | cached_db | db | cached_db | - +=========================+=======+=====+===========+====+===========+ - | Performance | ?????? | | ??? | | ??? | - +-------------------------+-------+-----+-----------+----+-----------+ - | Persistence | | ??? | ??? | ??? | ??? | - +-------------------------+-------+-----+-----------+----+-----------+ - | Foreign Key to User | | | | ??? | ??? | - +-------------------------+-------+-----+-----------+----+-----------+ - | Store IP and User Agent | | | | ??? | ??? | - +-------------------------+-------+-----+-----------+----+-----------+ - - - Compatibility - ============= - - - Python: **3.6**, **3.7**, **3.8** - - Django: **1.11**, **2.0**, **2.1**, **2.2**, **3.0**, **3.1** - - Installation - ============ - - If your system is in production and there are active sessions using another session backend, - you need to migrate them manually. We have no migration script. - - (1) If you want to use the ``cached_db`` backend, make sure you've - `configured your cache`_. If you have multiple caches defined in ``CACHES``, Django - will use the default cache. To use another cache, set ``SESSION_CACHE_ALIAS`` to the - name of that cache. - - (2) Install the latest version from PyPI: - - .. code-block:: sh - - pip install django-qsessions - - (3) In settings: - - - In ``INSTALLED_APPS`` replace ``'django.contrib.sessions'`` with ``'qsessions'``. - - - In ``MIDDLEWARE`` or ``MIDDLEWARE_CLASSES`` replace - ``'django.contrib.sessions.middleware.SessionMiddleware'`` with - ``'qsessions.middleware.SessionMiddleware'``. - - - Set ``SESSION_ENGINE`` to: - - - ``'qsessions.backends.cached_db'`` if you want to use ``cached_db`` backend. - - ``'qsessions.backends.db'`` if you want to use ``db`` backend. - - (4) Run migrations to create ``qsessions.models.Session`` model. - - .. code-block:: sh - - python manage.py migrate qsessions - - To enable location detection using GeoIP2 (optional): - - (5) Install ``geoip2`` package: - - .. code-block:: sh - - pip install geoip2 - - (6) Set ``GEOIP_PATH`` to a directory for storing GeoIP2 database. - - (7) Run the following command to download latest GeoIP2 database. You can add this - command to a cron job to update GeoIP2 DB automatically. - Due to `Maxmind license changes`_ you will need to acquire and use a license key for - downloading the databases. You can pass the key on the command line, or in the ``MAXMIND_LICENSE_KEY`` - environment variable. - - .. code-block:: sh - - python manage.py download_geoip_db -k mykey - - Usage - ===== - - django-qsessions has a custom ``Session`` model with following extra fields: - ``user``, ``user_agent``, ``created_at``, ``updated_at``, ``ip``. - - Getting a user's sessions: - - .. code-block:: python - - user.session_set.filter(expire_date__gt=timezone.now()) - - Deleting a session: - - .. code-block:: python - - # Deletes session from both DB and cache - session.delete() - - Logout a user: - - .. code-block:: python - - user.session_set.all().delete() - - Session creation time (user login time): - - .. code-block:: python - - >>> session.created_at - datetime.datetime(2018, 6, 12, 17, 9, 17, 443909, tzinfo=<UTC>) - - IP and user agent: - - .. code-block:: python - - >>> session.ip - '127.0.0.1' - >>> session.user_agent - 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' - - And if you have configured GeoIP2, you can call ``.location()``, ``.location_info()``: - - .. code-block:: python - - >>> session.location() - 'Tehran, Iran' - - >>> session.location_info() - {'city': 'Tehran', 'continent_code': 'AS', 'continent_name': 'Asia', 'country_code': 'IR', 'country_name': 'Iran', 'time_zone': 'Asia/Tehran', ...} - - Admin page: - - .. image:: https://user-images.githubusercontent.com/2115303/41525284-b0b258b0-72f5-11e8-87f1-8770e0094f4c.png - - Caveats - ------- - - - ``session.updated_at`` is not the session's last activity. It's updated each time the session - object in DB is saved. (e.g. when user logs in, or when ip, user agent, or session data changes) - - Why not ``django-user-sessions``? - ================================= - - `django-user-sessions`_ has the same functionality, - but only extends the ``db`` backend. Using a cache can improve performance. - - We got ideas and some codes from django-user-sessions. - Many thanks to `Bouke Haarsma`_ for writing django-user-sessions. - - Development - =========== - - - Install development dependencies in your virtualenv with ``pip install -e '.[dev]'`` - - - Run tests with coverage: - - - ``py.test --cov --ds tests.settings_db`` - - ``py.test --cov --ds tests.settings_cached_db`` - - - Apply **black** code style (using the latest version of black): - - .. code-block:: sh - - black -l 120 qsessions tests setup.py - - TODO - ==== - - - Write better documentation. - - - Explain how it works (in summary) - - Add more details to existing documentation. - - - Write more tests - - - Performance benchmark (and compare with Django's ``cached_db``) - - Contributions are welcome! - - License - ======= - - MIT - - .. _`configured your cache`: https://docs.djangoproject.com/en/dev/topics/cache/ - .. _`django-user-sessions`: https://github.com/Bouke/django-user-sessions - .. _`Bouke Haarsma`: https://github.com/Bouke - .. _`Maxmind license changes`: https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/ - Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Framework :: Django -Classifier: Framework :: Django :: 1.11 -Classifier: Framework :: Django :: 2.0 -Classifier: Framework :: Django :: 2.1 Classifier: Framework :: Django :: 2.2 Classifier: Framework :: Django :: 3.0 Classifier: Framework :: Django :: 3.1 +Classifier: Framework :: Django :: 3.2 +Classifier: Framework :: Django :: 4.0 Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent @@ -239,6 +22,228 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Internet :: WWW/HTTP :: Session Classifier: Topic :: Security Provides-Extra: dev +License-File: LICENSE.txt + +================ +Django QSessions +================ + +.. image:: https://img.shields.io/pypi/v/django-qsessions.svg + :target: https://pypi.python.org/pypi/django-qsessions/ + +.. image:: https://github.com/QueraTeam/django-qsessions/workflows/Tests/badge.svg + :target: https://github.com/QueraTeam/django-qsessions/actions + +.. image:: https://img.shields.io/github/license/QueraTeam/django-qsessions.svg + :target: https://github.com/QueraTeam/django-qsessions/blob/master/LICENSE.txt + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + +**django-qsessions** offers two extended session backends for Django. +They extend Django's ``db`` and ``cached_db`` backends (and ``Session`` model) +with following extra features: + +- Sessions have a foreign key to User +- Sessions store IP and User Agent + +These features help you implement "Session Management" and show a list of active sessions to the user. +You can display IP, location and user agent for each session and add an option to revoke sessions. + + +Comparison +========== + +Here is a brief comparison between Django's session backends (db, cache, cached_db), and django-qsessions. + ++-------------------------+-------------------------+----------------+ +| | django | qsessions | ++ +-------+-----+-----------+----+-----------+ +| | cache | db | cached_db | db | cached_db | ++=========================+=======+=====+===========+====+===========+ +| Performance | ?????? | | ??? | | ??? | ++-------------------------+-------+-----+-----------+----+-----------+ +| Persistence | | ??? | ??? | ??? | ??? | ++-------------------------+-------+-----+-----------+----+-----------+ +| Foreign Key to User | | | | ??? | ??? | ++-------------------------+-------+-----+-----------+----+-----------+ +| Store IP and User Agent | | | | ??? | ??? | ++-------------------------+-------+-----+-----------+----+-----------+ + + +Compatibility +============= + +- Python: **3.6**, **3.7**, **3.8**, **3.9**, **3.10** +- Django: **2.2**, **3.0**, **3.1**, **3.2**, **4.0** + +Installation +============ + +If your system is in production and there are active sessions using another session backend, +you need to migrate them manually. We have no migration script. + +(1) If you want to use the ``cached_db`` backend, make sure you've + `configured your cache`_. If you have multiple caches defined in ``CACHES``, Django + will use the default cache. To use another cache, set ``SESSION_CACHE_ALIAS`` to the + name of that cache. + +(2) Install the latest version from PyPI: + + .. code-block:: sh + + pip install django-qsessions + +(3) In settings: + + - In ``INSTALLED_APPS`` replace ``'django.contrib.sessions'`` with ``'qsessions'``. + + - In ``MIDDLEWARE`` or ``MIDDLEWARE_CLASSES`` replace + ``'django.contrib.sessions.middleware.SessionMiddleware'`` with + ``'qsessions.middleware.SessionMiddleware'``. + + - Set ``SESSION_ENGINE`` to: + + - ``'qsessions.backends.cached_db'`` if you want to use ``cached_db`` backend. + - ``'qsessions.backends.db'`` if you want to use ``db`` backend. + +(4) Run migrations to create ``qsessions.models.Session`` model. + + .. code-block:: sh + + python manage.py migrate qsessions + +To enable location detection using GeoIP2 (optional): + +(5) Install ``geoip2`` package: + + .. code-block:: sh + + pip install geoip2 + +(6) Set ``GEOIP_PATH`` to a directory for storing GeoIP2 database. + +(7) Run the following command to download latest GeoIP2 database. You can add this + command to a cron job to update GeoIP2 DB automatically. + Due to `Maxmind license changes`_ you will need to acquire and use a license key for + downloading the databases. You can pass the key on the command line, or in the ``MAXMIND_LICENSE_KEY`` + environment variable. + + .. code-block:: sh + + python manage.py download_geoip_db -k mykey + +Usage +===== + +django-qsessions has a custom ``Session`` model with following extra fields: +``user``, ``user_agent``, ``created_at``, ``updated_at``, ``ip``. + +Getting a user's sessions: + +.. code-block:: python + + user.session_set.filter(expire_date__gt=timezone.now()) + +Deleting a session: + +.. code-block:: python + + # Deletes session from both DB and cache + session.delete() + +Logout a user: + +.. code-block:: python + + user.session_set.all().delete() + +Session creation time (user login time): + +.. code-block:: python + + >>> session.created_at + datetime.datetime(2018, 6, 12, 17, 9, 17, 443909, tzinfo=<UTC>) + +IP and user agent: + +.. code-block:: python + + >>> session.ip + '127.0.0.1' + >>> session.user_agent + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' + +And if you have configured GeoIP2, you can call ``.location()``, ``.location_info()``: + +.. code-block:: python + + >>> session.location() + 'Tehran, Iran' + + >>> session.location_info() + {'city': 'Tehran', 'continent_code': 'AS', 'continent_name': 'Asia', 'country_code': 'IR', 'country_name': 'Iran', 'time_zone': 'Asia/Tehran', ...} + +Admin page: + +.. image:: https://user-images.githubusercontent.com/2115303/41525284-b0b258b0-72f5-11e8-87f1-8770e0094f4c.png + +Caveats +------- + +- ``session.updated_at`` is not the session's last activity. It's updated each time the session + object in DB is saved. (e.g. when user logs in, or when ip, user agent, or session data changes) + +Why not ``django-user-sessions``? +================================= + +`django-user-sessions`_ has the same functionality, +but only extends the ``db`` backend. Using a cache can improve performance. + +We got ideas and some codes from django-user-sessions. +Many thanks to `Bouke Haarsma`_ for writing django-user-sessions. + +Development +=========== + +- Create and activate a python virtualenv. + +- Install development dependencies in your virtualenv with ``pip install -e '.[dev]'`` + +- Install pre-commit hooks with ``pre-commit install`` + +- Run tests with coverage: + + - ``py.test --cov --ds tests.settings_db`` + - ``py.test --cov --ds tests.settings_cached_db`` + +TODO +==== + +- Write better documentation. + + - Explain how it works (in summary) + - Add more details to existing documentation. + +- Write more tests + +- Performance benchmark (and compare with Django's ``cached_db``) + +Contributions are welcome! + +License +======= + +MIT + +.. _`configured your cache`: https://docs.djangoproject.com/en/dev/topics/cache/ +.. _`django-user-sessions`: https://github.com/Bouke/django-user-sessions +.. _`Bouke Haarsma`: https://github.com/Bouke +.. _`Maxmind license changes`: https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/ + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/README.rst new/django-qsessions-1.1.3/README.rst --- old/django-qsessions-1.1.1/README.rst 2020-09-08 11:07:59.000000000 +0200 +++ new/django-qsessions-1.1.3/README.rst 2021-12-24 10:10:53.000000000 +0100 @@ -1,18 +1,18 @@ -.. image:: https://user-images.githubusercontent.com/2115303/35397912-f00efbb4-0205-11e8-89b5-3d4f585a4588.png +================ +Django QSessions +================ .. image:: https://img.shields.io/pypi/v/django-qsessions.svg :target: https://pypi.python.org/pypi/django-qsessions/ -.. image:: https://img.shields.io/travis/QueraTeam/django-qsessions.svg - :target: https://travis-ci.org/QueraTeam/django-qsessions +.. image:: https://github.com/QueraTeam/django-qsessions/workflows/Tests/badge.svg + :target: https://github.com/QueraTeam/django-qsessions/actions .. image:: https://img.shields.io/github/license/QueraTeam/django-qsessions.svg :target: https://github.com/QueraTeam/django-qsessions/blob/master/LICENSE.txt .. image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black - -------- + :target: https://github.com/psf/black **django-qsessions** offers two extended session backends for Django. They extend Django's ``db`` and ``cached_db`` backends (and ``Session`` model) @@ -21,6 +21,9 @@ - Sessions have a foreign key to User - Sessions store IP and User Agent +These features help you implement "Session Management" and show a list of active sessions to the user. +You can display IP, location and user agent for each session and add an option to revoke sessions. + Comparison ========== @@ -45,8 +48,8 @@ Compatibility ============= -- Python: **3.6**, **3.7**, **3.8** -- Django: **1.11**, **2.0**, **2.1**, **2.2**, **3.0**, **3.1** +- Python: **3.6**, **3.7**, **3.8**, **3.9**, **3.10** +- Django: **2.2**, **3.0**, **3.1**, **3.2**, **4.0** Installation ============ @@ -177,19 +180,17 @@ Development =========== +- Create and activate a python virtualenv. + - Install development dependencies in your virtualenv with ``pip install -e '.[dev]'`` +- Install pre-commit hooks with ``pre-commit install`` + - Run tests with coverage: - ``py.test --cov --ds tests.settings_db`` - ``py.test --cov --ds tests.settings_cached_db`` -- Apply **black** code style (using the latest version of black): - - .. code-block:: sh - - black -l 120 qsessions tests setup.py - TODO ==== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/django_qsessions.egg-info/PKG-INFO new/django-qsessions-1.1.3/django_qsessions.egg-info/PKG-INFO --- old/django-qsessions-1.1.1/django_qsessions.egg-info/PKG-INFO 2020-09-10 08:25:12.000000000 +0200 +++ new/django-qsessions-1.1.3/django_qsessions.egg-info/PKG-INFO 2021-12-24 10:13:55.000000000 +0100 @@ -1,237 +1,20 @@ Metadata-Version: 2.1 Name: django-qsessions -Version: 1.1.1 +Version: 1.1.3 Summary: Extended session backends for Django Home-page: https://github.com/QueraTeam/django-qsessions Author: Mohammad Javad Naderi License: MIT Download-URL: https://pypi.python.org/pypi/django-qsessions -Description: .. image:: https://user-images.githubusercontent.com/2115303/35397912-f00efbb4-0205-11e8-89b5-3d4f585a4588.png - - .. image:: https://img.shields.io/pypi/v/django-qsessions.svg - :target: https://pypi.python.org/pypi/django-qsessions/ - - .. image:: https://img.shields.io/travis/QueraTeam/django-qsessions.svg - :target: https://travis-ci.org/QueraTeam/django-qsessions - - .. image:: https://img.shields.io/github/license/QueraTeam/django-qsessions.svg - :target: https://github.com/QueraTeam/django-qsessions/blob/master/LICENSE.txt - - .. image:: https://img.shields.io/badge/code%20style-black-000000.svg - :target: https://github.com/psf/black - - ------- - - **django-qsessions** offers two extended session backends for Django. - They extend Django's ``db`` and ``cached_db`` backends (and ``Session`` model) - with following extra features: - - - Sessions have a foreign key to User - - Sessions store IP and User Agent - - - Comparison - ========== - - Here is a brief comparison between Django's session backends (db, cache, cached_db), and django-qsessions. - - +-------------------------+-------------------------+----------------+ - | | django | qsessions | - + +-------+-----+-----------+----+-----------+ - | | cache | db | cached_db | db | cached_db | - +=========================+=======+=====+===========+====+===========+ - | Performance | ?????? | | ??? | | ??? | - +-------------------------+-------+-----+-----------+----+-----------+ - | Persistence | | ??? | ??? | ??? | ??? | - +-------------------------+-------+-----+-----------+----+-----------+ - | Foreign Key to User | | | | ??? | ??? | - +-------------------------+-------+-----+-----------+----+-----------+ - | Store IP and User Agent | | | | ??? | ??? | - +-------------------------+-------+-----+-----------+----+-----------+ - - - Compatibility - ============= - - - Python: **3.6**, **3.7**, **3.8** - - Django: **1.11**, **2.0**, **2.1**, **2.2**, **3.0**, **3.1** - - Installation - ============ - - If your system is in production and there are active sessions using another session backend, - you need to migrate them manually. We have no migration script. - - (1) If you want to use the ``cached_db`` backend, make sure you've - `configured your cache`_. If you have multiple caches defined in ``CACHES``, Django - will use the default cache. To use another cache, set ``SESSION_CACHE_ALIAS`` to the - name of that cache. - - (2) Install the latest version from PyPI: - - .. code-block:: sh - - pip install django-qsessions - - (3) In settings: - - - In ``INSTALLED_APPS`` replace ``'django.contrib.sessions'`` with ``'qsessions'``. - - - In ``MIDDLEWARE`` or ``MIDDLEWARE_CLASSES`` replace - ``'django.contrib.sessions.middleware.SessionMiddleware'`` with - ``'qsessions.middleware.SessionMiddleware'``. - - - Set ``SESSION_ENGINE`` to: - - - ``'qsessions.backends.cached_db'`` if you want to use ``cached_db`` backend. - - ``'qsessions.backends.db'`` if you want to use ``db`` backend. - - (4) Run migrations to create ``qsessions.models.Session`` model. - - .. code-block:: sh - - python manage.py migrate qsessions - - To enable location detection using GeoIP2 (optional): - - (5) Install ``geoip2`` package: - - .. code-block:: sh - - pip install geoip2 - - (6) Set ``GEOIP_PATH`` to a directory for storing GeoIP2 database. - - (7) Run the following command to download latest GeoIP2 database. You can add this - command to a cron job to update GeoIP2 DB automatically. - Due to `Maxmind license changes`_ you will need to acquire and use a license key for - downloading the databases. You can pass the key on the command line, or in the ``MAXMIND_LICENSE_KEY`` - environment variable. - - .. code-block:: sh - - python manage.py download_geoip_db -k mykey - - Usage - ===== - - django-qsessions has a custom ``Session`` model with following extra fields: - ``user``, ``user_agent``, ``created_at``, ``updated_at``, ``ip``. - - Getting a user's sessions: - - .. code-block:: python - - user.session_set.filter(expire_date__gt=timezone.now()) - - Deleting a session: - - .. code-block:: python - - # Deletes session from both DB and cache - session.delete() - - Logout a user: - - .. code-block:: python - - user.session_set.all().delete() - - Session creation time (user login time): - - .. code-block:: python - - >>> session.created_at - datetime.datetime(2018, 6, 12, 17, 9, 17, 443909, tzinfo=<UTC>) - - IP and user agent: - - .. code-block:: python - - >>> session.ip - '127.0.0.1' - >>> session.user_agent - 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' - - And if you have configured GeoIP2, you can call ``.location()``, ``.location_info()``: - - .. code-block:: python - - >>> session.location() - 'Tehran, Iran' - - >>> session.location_info() - {'city': 'Tehran', 'continent_code': 'AS', 'continent_name': 'Asia', 'country_code': 'IR', 'country_name': 'Iran', 'time_zone': 'Asia/Tehran', ...} - - Admin page: - - .. image:: https://user-images.githubusercontent.com/2115303/41525284-b0b258b0-72f5-11e8-87f1-8770e0094f4c.png - - Caveats - ------- - - - ``session.updated_at`` is not the session's last activity. It's updated each time the session - object in DB is saved. (e.g. when user logs in, or when ip, user agent, or session data changes) - - Why not ``django-user-sessions``? - ================================= - - `django-user-sessions`_ has the same functionality, - but only extends the ``db`` backend. Using a cache can improve performance. - - We got ideas and some codes from django-user-sessions. - Many thanks to `Bouke Haarsma`_ for writing django-user-sessions. - - Development - =========== - - - Install development dependencies in your virtualenv with ``pip install -e '.[dev]'`` - - - Run tests with coverage: - - - ``py.test --cov --ds tests.settings_db`` - - ``py.test --cov --ds tests.settings_cached_db`` - - - Apply **black** code style (using the latest version of black): - - .. code-block:: sh - - black -l 120 qsessions tests setup.py - - TODO - ==== - - - Write better documentation. - - - Explain how it works (in summary) - - Add more details to existing documentation. - - - Write more tests - - - Performance benchmark (and compare with Django's ``cached_db``) - - Contributions are welcome! - - License - ======= - - MIT - - .. _`configured your cache`: https://docs.djangoproject.com/en/dev/topics/cache/ - .. _`django-user-sessions`: https://github.com/Bouke/django-user-sessions - .. _`Bouke Haarsma`: https://github.com/Bouke - .. _`Maxmind license changes`: https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/ - Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Framework :: Django -Classifier: Framework :: Django :: 1.11 -Classifier: Framework :: Django :: 2.0 -Classifier: Framework :: Django :: 2.1 Classifier: Framework :: Django :: 2.2 Classifier: Framework :: Django :: 3.0 Classifier: Framework :: Django :: 3.1 +Classifier: Framework :: Django :: 3.2 +Classifier: Framework :: Django :: 4.0 Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent @@ -239,6 +22,228 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 Classifier: Topic :: Internet :: WWW/HTTP :: Session Classifier: Topic :: Security Provides-Extra: dev +License-File: LICENSE.txt + +================ +Django QSessions +================ + +.. image:: https://img.shields.io/pypi/v/django-qsessions.svg + :target: https://pypi.python.org/pypi/django-qsessions/ + +.. image:: https://github.com/QueraTeam/django-qsessions/workflows/Tests/badge.svg + :target: https://github.com/QueraTeam/django-qsessions/actions + +.. image:: https://img.shields.io/github/license/QueraTeam/django-qsessions.svg + :target: https://github.com/QueraTeam/django-qsessions/blob/master/LICENSE.txt + +.. image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/psf/black + +**django-qsessions** offers two extended session backends for Django. +They extend Django's ``db`` and ``cached_db`` backends (and ``Session`` model) +with following extra features: + +- Sessions have a foreign key to User +- Sessions store IP and User Agent + +These features help you implement "Session Management" and show a list of active sessions to the user. +You can display IP, location and user agent for each session and add an option to revoke sessions. + + +Comparison +========== + +Here is a brief comparison between Django's session backends (db, cache, cached_db), and django-qsessions. + ++-------------------------+-------------------------+----------------+ +| | django | qsessions | ++ +-------+-----+-----------+----+-----------+ +| | cache | db | cached_db | db | cached_db | ++=========================+=======+=====+===========+====+===========+ +| Performance | ?????? | | ??? | | ??? | ++-------------------------+-------+-----+-----------+----+-----------+ +| Persistence | | ??? | ??? | ??? | ??? | ++-------------------------+-------+-----+-----------+----+-----------+ +| Foreign Key to User | | | | ??? | ??? | ++-------------------------+-------+-----+-----------+----+-----------+ +| Store IP and User Agent | | | | ??? | ??? | ++-------------------------+-------+-----+-----------+----+-----------+ + + +Compatibility +============= + +- Python: **3.6**, **3.7**, **3.8**, **3.9**, **3.10** +- Django: **2.2**, **3.0**, **3.1**, **3.2**, **4.0** + +Installation +============ + +If your system is in production and there are active sessions using another session backend, +you need to migrate them manually. We have no migration script. + +(1) If you want to use the ``cached_db`` backend, make sure you've + `configured your cache`_. If you have multiple caches defined in ``CACHES``, Django + will use the default cache. To use another cache, set ``SESSION_CACHE_ALIAS`` to the + name of that cache. + +(2) Install the latest version from PyPI: + + .. code-block:: sh + + pip install django-qsessions + +(3) In settings: + + - In ``INSTALLED_APPS`` replace ``'django.contrib.sessions'`` with ``'qsessions'``. + + - In ``MIDDLEWARE`` or ``MIDDLEWARE_CLASSES`` replace + ``'django.contrib.sessions.middleware.SessionMiddleware'`` with + ``'qsessions.middleware.SessionMiddleware'``. + + - Set ``SESSION_ENGINE`` to: + + - ``'qsessions.backends.cached_db'`` if you want to use ``cached_db`` backend. + - ``'qsessions.backends.db'`` if you want to use ``db`` backend. + +(4) Run migrations to create ``qsessions.models.Session`` model. + + .. code-block:: sh + + python manage.py migrate qsessions + +To enable location detection using GeoIP2 (optional): + +(5) Install ``geoip2`` package: + + .. code-block:: sh + + pip install geoip2 + +(6) Set ``GEOIP_PATH`` to a directory for storing GeoIP2 database. + +(7) Run the following command to download latest GeoIP2 database. You can add this + command to a cron job to update GeoIP2 DB automatically. + Due to `Maxmind license changes`_ you will need to acquire and use a license key for + downloading the databases. You can pass the key on the command line, or in the ``MAXMIND_LICENSE_KEY`` + environment variable. + + .. code-block:: sh + + python manage.py download_geoip_db -k mykey + +Usage +===== + +django-qsessions has a custom ``Session`` model with following extra fields: +``user``, ``user_agent``, ``created_at``, ``updated_at``, ``ip``. + +Getting a user's sessions: + +.. code-block:: python + + user.session_set.filter(expire_date__gt=timezone.now()) + +Deleting a session: + +.. code-block:: python + + # Deletes session from both DB and cache + session.delete() + +Logout a user: + +.. code-block:: python + + user.session_set.all().delete() + +Session creation time (user login time): + +.. code-block:: python + + >>> session.created_at + datetime.datetime(2018, 6, 12, 17, 9, 17, 443909, tzinfo=<UTC>) + +IP and user agent: + +.. code-block:: python + + >>> session.ip + '127.0.0.1' + >>> session.user_agent + 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' + +And if you have configured GeoIP2, you can call ``.location()``, ``.location_info()``: + +.. code-block:: python + + >>> session.location() + 'Tehran, Iran' + + >>> session.location_info() + {'city': 'Tehran', 'continent_code': 'AS', 'continent_name': 'Asia', 'country_code': 'IR', 'country_name': 'Iran', 'time_zone': 'Asia/Tehran', ...} + +Admin page: + +.. image:: https://user-images.githubusercontent.com/2115303/41525284-b0b258b0-72f5-11e8-87f1-8770e0094f4c.png + +Caveats +------- + +- ``session.updated_at`` is not the session's last activity. It's updated each time the session + object in DB is saved. (e.g. when user logs in, or when ip, user agent, or session data changes) + +Why not ``django-user-sessions``? +================================= + +`django-user-sessions`_ has the same functionality, +but only extends the ``db`` backend. Using a cache can improve performance. + +We got ideas and some codes from django-user-sessions. +Many thanks to `Bouke Haarsma`_ for writing django-user-sessions. + +Development +=========== + +- Create and activate a python virtualenv. + +- Install development dependencies in your virtualenv with ``pip install -e '.[dev]'`` + +- Install pre-commit hooks with ``pre-commit install`` + +- Run tests with coverage: + + - ``py.test --cov --ds tests.settings_db`` + - ``py.test --cov --ds tests.settings_cached_db`` + +TODO +==== + +- Write better documentation. + + - Explain how it works (in summary) + - Add more details to existing documentation. + +- Write more tests + +- Performance benchmark (and compare with Django's ``cached_db``) + +Contributions are welcome! + +License +======= + +MIT + +.. _`configured your cache`: https://docs.djangoproject.com/en/dev/topics/cache/ +.. _`django-user-sessions`: https://github.com/Bouke/django-user-sessions +.. _`Bouke Haarsma`: https://github.com/Bouke +.. _`Maxmind license changes`: https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/ + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/django_qsessions.egg-info/SOURCES.txt new/django-qsessions-1.1.3/django_qsessions.egg-info/SOURCES.txt --- old/django-qsessions-1.1.1/django_qsessions.egg-info/SOURCES.txt 2020-09-10 08:25:13.000000000 +0200 +++ new/django-qsessions-1.1.3/django_qsessions.egg-info/SOURCES.txt 2021-12-24 10:13:55.000000000 +0100 @@ -2,9 +2,9 @@ LICENSE.txt MANIFEST.in README.rst +pyproject.toml setup.cfg setup.py -tox.ini django_qsessions.egg-info/PKG-INFO django_qsessions.egg-info/SOURCES.txt django_qsessions.egg-info/dependency_links.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/django_qsessions.egg-info/requires.txt new/django-qsessions-1.1.3/django_qsessions.egg-info/requires.txt --- old/django-qsessions-1.1.1/django_qsessions.egg-info/requires.txt 2020-09-10 08:25:12.000000000 +0200 +++ new/django-qsessions-1.1.3/django_qsessions.egg-info/requires.txt 2021-12-24 10:13:55.000000000 +0100 @@ -3,6 +3,7 @@ django-ipware>=2.0.0 [dev] +pre-commit geoip2 pytest pytest-cov diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/pyproject.toml new/django-qsessions-1.1.3/pyproject.toml --- old/django-qsessions-1.1.1/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/django-qsessions-1.1.3/pyproject.toml 2021-12-24 10:10:53.000000000 +0100 @@ -0,0 +1,9 @@ +[tool.black] +line-length = 120 +include = '\.pyi?$' +exclude = '/\..+/' + +[tool.isort] +profile = "black" +line_length = 120 +skip_gitignore = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/qsessions/admin.py new/django-qsessions-1.1.3/qsessions/admin.py --- old/django-qsessions-1.1.1/qsessions/admin.py 2020-09-09 11:47:52.000000000 +0200 +++ new/django-qsessions-1.1.3/qsessions/admin.py 2021-12-24 10:10:53.000000000 +0100 @@ -1,11 +1,13 @@ -from django.utils.translation import gettext as _ +from pprint import pformat + +from django.contrib import admin from django.contrib.auth import get_user_model +from django.urls import reverse from django.utils.html import format_html from django.utils.timezone import now -from django.contrib import admin -from django.urls import reverse +from django.utils.translation import gettext_lazy as _ + from .models import Session -from pprint import pformat def linkify(field_name): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/qsessions/geoip.py new/django-qsessions-1.1.3/qsessions/geoip.py --- old/django-qsessions-1.1.1/qsessions/geoip.py 2020-07-01 20:51:15.000000000 +0200 +++ new/django-qsessions-1.1.3/qsessions/geoip.py 2021-12-24 10:10:53.000000000 +0100 @@ -1,6 +1,7 @@ from __future__ import unicode_literals import warnings + from django.contrib.gis.geoip2 import HAS_GEOIP2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/qsessions/middleware.py new/django-qsessions-1.1.3/qsessions/middleware.py --- old/django-qsessions-1.1.1/qsessions/middleware.py 2020-09-08 11:04:31.000000000 +0200 +++ new/django-qsessions-1.1.3/qsessions/middleware.py 2021-12-24 10:10:53.000000000 +0100 @@ -1,5 +1,5 @@ -from django.contrib.sessions.middleware import SessionMiddleware as DjSessionMiddleware from django.conf import settings +from django.contrib.sessions.middleware import SessionMiddleware as DjSessionMiddleware from ipware import get_client_ip @@ -8,6 +8,6 @@ session_key = request.COOKIES.get(settings.SESSION_COOKIE_NAME) request.session = self.SessionStore( ip=get_client_ip(request)[0], - user_agent=request.META.get("HTTP_USER_AGENT", ""), + user_agent=request.headers.get("User-Agent", ""), session_key=session_key, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/qsessions/migrations/0001_initial.py new/django-qsessions-1.1.3/qsessions/migrations/0001_initial.py --- old/django-qsessions-1.1.1/qsessions/migrations/0001_initial.py 2020-07-01 20:57:30.000000000 +0200 +++ new/django-qsessions-1.1.3/qsessions/migrations/0001_initial.py 2021-12-24 10:10:53.000000000 +0100 @@ -1,10 +1,10 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-12-19 16:00 from __future__ import unicode_literals +import django.db.models.deletion from django.conf import settings from django.db import migrations, models -import django.db.models.deletion + import qsessions.models diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/qsessions/migrations/0002_session_created_at.py new/django-qsessions-1.1.3/qsessions/migrations/0002_session_created_at.py --- old/django-qsessions-1.1.1/qsessions/migrations/0002_session_created_at.py 2020-09-08 11:03:26.000000000 +0200 +++ new/django-qsessions-1.1.3/qsessions/migrations/0002_session_created_at.py 2021-12-24 10:10:53.000000000 +0100 @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2018-02-05 06:55 from __future__ import unicode_literals diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/qsessions/models.py new/django-qsessions-1.1.3/qsessions/models.py --- old/django-qsessions-1.1.1/qsessions/models.py 2020-07-01 20:57:31.000000000 +0200 +++ new/django-qsessions-1.1.3/qsessions/models.py 2021-10-20 08:57:59.000000000 +0200 @@ -5,7 +5,7 @@ from django.core.cache import caches from django.db import models from django.utils import timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import qsessions.geoip as geoip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/setup.cfg new/django-qsessions-1.1.3/setup.cfg --- old/django-qsessions-1.1.1/setup.cfg 2020-09-10 08:25:19.885972500 +0200 +++ new/django-qsessions-1.1.3/setup.cfg 2021-12-24 10:13:55.987334500 +0100 @@ -1,6 +1,6 @@ [tool:pytest] -django_settings_module = tests.settings -norecursedirs = .git .tox +DJANGO_SETTINGS_MODULE = tests.settings_cached_db +norecursedirs = .git [egg_info] tag_build = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/setup.py new/django-qsessions-1.1.3/setup.py --- old/django-qsessions-1.1.1/setup.py 2020-09-10 08:21:20.000000000 +0200 +++ new/django-qsessions-1.1.3/setup.py 2021-12-24 10:10:53.000000000 +0100 @@ -1,13 +1,15 @@ import os -from setuptools import setup, find_packages -with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme: +from setuptools import find_packages, setup + +with open(os.path.join(os.path.dirname(__file__), "README.rst"), "r", encoding="UTF-8") as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) dev_requirements = [ + "pre-commit", "geoip2", # for testing GeoIP2 "pytest", "pytest-cov", @@ -16,7 +18,7 @@ setup( name="django-qsessions", - version="1.1.1", + version="1.1.3", description="Extended session backends for Django", long_description=README, author="Mohammad Javad Naderi", @@ -32,12 +34,11 @@ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", - "Framework :: Django :: 1.11", - "Framework :: Django :: 2.0", - "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Framework :: Django :: 3.0", "Framework :: Django :: 3.1", + "Framework :: Django :: 3.2", + "Framework :: Django :: 4.0", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", @@ -45,6 +46,8 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Internet :: WWW/HTTP :: Session", "Topic :: Security", ], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/tests/settings_base.py new/django-qsessions-1.1.3/tests/settings_base.py --- old/django-qsessions-1.1.1/tests/settings_base.py 2020-07-01 20:57:31.000000000 +0200 +++ new/django-qsessions-1.1.3/tests/settings_base.py 2021-12-24 10:10:53.000000000 +0100 @@ -4,6 +4,7 @@ SECRET_KEY = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" DEBUG = True +USE_TZ = False INSTALLED_APPS = [ "django.contrib.admin", @@ -39,7 +40,12 @@ }, ] -DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": os.path.join(BASE_DIR, "db.sqlite3")}} +DATABASES = { + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": os.path.join(BASE_DIR, "db.sqlite3"), + } +} STATIC_URL = "/static/" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/tests/test_admin.py new/django-qsessions-1.1.3/tests/test_admin.py --- old/django-qsessions-1.1.1/tests/test_admin.py 2020-07-01 20:51:10.000000000 +0200 +++ new/django-qsessions-1.1.3/tests/test_admin.py 2021-10-20 08:57:59.000000000 +0200 @@ -1,4 +1,3 @@ -# -- encoding: UTF-8 -- from __future__ import unicode_literals import pytest @@ -6,6 +5,7 @@ @pytest.mark.django_db +@pytest.mark.filterwarnings("ignore:The address 127.0.0.1 is not in the database") def test_smoke_admin(admin_client): admin_client.get("/modify_session/", HTTP_USER_AGENT="Chrome/70.0.3538.102", REMOTE_ADDR="89.160.20.112") resp = admin_client.get("/admin/qsessions/session/?active=1&owner=my") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/tests/test_model.py new/django-qsessions-1.1.3/tests/test_model.py --- old/django-qsessions-1.1.1/tests/test_model.py 2020-07-01 20:51:10.000000000 +0200 +++ new/django-qsessions-1.1.3/tests/test_model.py 2021-10-20 08:57:59.000000000 +0200 @@ -1,5 +1,3 @@ -# -- encoding: UTF-8 -- - from __future__ import unicode_literals import pytest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/tests/urls.py new/django-qsessions-1.1.3/tests/urls.py --- old/django-qsessions-1.1.1/tests/urls.py 2020-07-01 20:51:10.000000000 +0200 +++ new/django-qsessions-1.1.3/tests/urls.py 2021-12-24 10:10:53.000000000 +0100 @@ -1,6 +1,6 @@ -from django.conf.urls import url from django.contrib import admin from django.http import HttpResponse, JsonResponse +from django.urls import path def read_session(request): @@ -13,7 +13,7 @@ urlpatterns = [ - url(r"^read_session/$", read_session), - url(r"^modify_session/$", modify_session), - url(r"^admin/", admin.site.urls), + path("read_session/", read_session), + path("modify_session/", modify_session), + path("admin/", admin.site.urls), ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/django-qsessions-1.1.1/tox.ini new/django-qsessions-1.1.3/tox.ini --- old/django-qsessions-1.1.1/tox.ini 2020-08-19 17:43:08.000000000 +0200 +++ new/django-qsessions-1.1.3/tox.ini 1970-01-01 01:00:00.000000000 +0100 @@ -1,34 +0,0 @@ -[tox] -envlist = - py{36,37}-{dj111,dj20,dj21}-{db,cached_db}, - py{36,37,38}-{dj22,dj30,dj31,djmaster}-{db,cached_db} - -[travis] -unignore_outcomes = True - -[travis:env] -DJANGO = - 1.11: dj111 - 2.0: dj20 - 2.1: dj21 - 2.2: dj22 - 3.0: dj30 - 3.1: dj31 - master: djmaster - -[testenv] -extras = dev -commands= - db: py.test --ds=tests.settings_db {posargs} - cached_db: py.test --ds=tests.settings_cached_db {posargs} -usedevelop = True -deps= - dj111: Django>=1.11,<2.0 - dj20: Django>=2.0,<2.1 - dj21: Django>=2.1,<2.2 - dj22: Django>=2.2,<2.3 - dj30: Django>=3.0,<3.1 - dj31: Django>=3.1,<3.2 - djmaster: https://github.com/django/django/archive/master.tar.gz -ignore_outcome = - djmaster: True