# Updating old Django version code to version 4

**URL:** <https://forum.djangoproject.com/t/updating-old-django-version-code-to-version-4/14329>\
**Category:** Forms & APIs\
**Created:** [June 17, 2022, 1:51am UTC](https://forum.djangoproject.com/t/updating-old-django-version-code-to-version-4/14329 "2022-06-17T01:51:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeandroCGMS](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/leandrocgms/32/8905_2.png) [@LeandroCGMS](https://forum.djangoproject.com/u/LeandroCGMS)\
**Post date:** [June 17, 2022, 1:51am UTC](https://forum.djangoproject.com/t/updating-old-django-version-code-to-version-4/14329/1 "2022-06-17T01:51:04Z")

</div>

Solution:

```auto
from rest_framework_simplejwt.views import (
     TokenObtainPairView,
     TokenRefreshView,
)

path('get_csrftoken_angular/', TokenObtainPairView.as_view(), name='get_csrftoken_angular'),
re_path(r'^refresh-token/', TokenRefreshView.as_view(), name='refresh-token'),

```

* * *

In a new branch, I made several changes to use modern code, in line with the new version of Django and Python, such as changing “url(r’pattern\_url’, blablabla” to “re\_path(r’', blablabla)”. Now, I need to know how to change this code snippet below, since instead of “djangorestframework-jwt==1.11.0” I’m using “djangorestframework-simplejwt”:

```auto
from rest_framework_jwt.views import obtain_jwt_token
from rest_framework_jwt.views import refresh_jwt_token

```

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [June 17, 2022, 1:14pm UTC](https://forum.djangoproject.com/t/updating-old-django-version-code-to-version-4/14329/2 "2022-06-17T13:14:01Z")

</div>

According to what I can see by a casual inspection of the docs, djangorestframework-simplejwt is not a drop-in replacement for djangorestframework-jwt.

(See [Status · Issue #484 · jpadilla/django-rest-framework-jwt · GitHub](https://github.com/jpadilla/django-rest-framework-jwt/issues/484) for some other information on this.)

You’ll have to read the docs for both packages to see how the two may operate differently to figure out what changes may be needed to your code to work with the newer library.
