1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
.. _upgrading:
************************************
Upgrading Django-GUID 2.x.x to 3.x.x
************************************
Upgrading to ``Django>=3.1.1`` and using async/ASGI requires you to use ``Django-GUID`` version 3 or higher.
In order to upgrade, you need to do the following:
1. Change Middleware
--------------------
* **From:** ``django_guid.middleware.GuidMiddleware``
* **To:** ``django_guid.middleware.guid_middleware``
.. code-block:: python
MIDDLEWARE = [
'django_guid.middleware.guid_middleware',
...
]
2. Change API functions (if you used them)
------------------------------------------
**From:**
.. code-block:: python
from django_guid.middleware import GuidMiddleware
GuidMiddleware.get_guid()
GuidMiddleware.set_guid('x')
GuidMiddleware.delete_guid()
**To:**
.. code-block:: python
from django_guid import clear_guid, get_guid, set_guid
get_guid()
set_guid('x')
clear_guid() # Note the name change from delete to clear
|