Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Cannot start docker for django
Hi I am trying to install django with Docker and I cant not run the Django application. But my postgresql still work normally Here is my terminal My Dockerfile # docker/app/Dockerfile FROM python:3.11-alpine LABEL maintainer="Tran Son Hoang son.hoang01@gmail.com" ENV PYTHONUNBUFFERED=1 \ PROJECT_DIR=/app/ COPY . ${PROJECT_DIR} #COPY --chmod=755 docker/app/entrypoint.sh /poinofsale_entrypoint.sh WORKDIR ${PROJECT_DIR} EXPOSE 8000 8000 RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev curl bash RUN pip install --no-cache-dir pipenv RUN pipenv install --system --deploy RUN pipenv --clear #ENTRYPOINT ["sh", "/poinofsale_entrypoint.sh"] CMD ["gunicorn", "-c", "docker/app/gunicorn.py"] My docker-compose.yml file # docker-compose.yml version: '3.9' services: # Django application app: build: context: . dockerfile: docker/app/Dockerfile container_name: poinofsale-app ports: - "8000:8000" env_file: - .env volumes: - ./:/app/ depends_on: - postgres # PostgreSQL Database postgres: image: postgres:15-alpine container_name: django-docker-db ports: - "5432:5432" env_file: - .env volumes: - pgdata:/var/lib/postgresql/data restart: unless-stopped volumes: pgdata: networks: default: name: django-network The result is like above, even I run successfull but when I open my Docker desktop, the result is like image below The status is always Exited for django app. Anyone have hint for this? I have tried to research and most of the result is same with my configuration. -
Django Python : Manager isn't accessible via model instances
I'm trying to query an object set and use the number of the amount of objects to do a for loop that will present parameters of each object. I'm using a 2D array to store the parameters so they can be presented respective to their object. I would like not just a solution but a better way in general of doing this .p.s. I'm new to django This is the code from views.py def flashcard(response): form = Flashcard_verif(response.POST) if response.method == "POST" and form.is_valid(): head = form.cleaned_data["header"] ques = form.cleaned_data["question"] ans = form.cleaned_data["answer"] flashcard_data = Flashcard(header=head, question=ques, answer=ans) # this is where the error is occuring flashcard_obj = Flashcard(header=head, question=ques, answer=ans).objects.all() rawHeader, rawQuestion, rawAnswer = Flashcard(header=head, question=ques, answer=ans).flash_format() flashcard_data.save() if len(flashcard_lib) > 1: for i in range(0, len(flashcard_lib), 1): flashcard_lib.append([rawHeader, rawQuestion, rawAnswer]) print(flashcard_lib) return render(response, "main/Flashcard.html", { "form":form, "Flashcard_lib":flashcard_lib, "flashcard":flashcard_obj}) else: flashcard_lib.append([rawHeader, rawQuestion, rawAnswer]) print(flashcard_lib) return render(response, "main/Flashcard.html", { "form":form, "header":rawHeader, "question":rawQuestion, "answer":rawAnswer }) else: form = Flashcard_verif() return render(response, "main/Flashcard.html", { "form":form}) This is my template that utilises the 2d array: <div class="flashcard-view" id="flash" style="visibility: hidden"> {% if Flashcard_lib|length >= 2 %} {% for i in flashcard_obj %} <div class="flashcard"> {{ i.0 }} {{ i.1 }} {{ i.2 }} … -
Updating urlpatterns for django-smart-selects
I am attempting my first django project by building on top of the polls example from the django documentation. I would like to add linked/cascading dropdowns to a form and found my way to django-smart-selects. I read the documentation but wasn't sure how integrate the suggested updates to project's urls.py urlpatterns from the documentation into what I have currently. The smart select urls mentioned in the linked documentation urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^chaining/', include('smart_selects.urls')), ) The current value of urlpatterns in my project's ursl.py file. urlpatterns = [ path('', include('TimeTracking.urls')), path('admin/', admin.site.urls), path('data-browser/', include('data_browser.urls')), ] Obviously adding those entries to my urlpatterns = [] wouldn't work but I attemtped it anyway... NameError: name 'url' is not defined -
Create wordpress user from Django web application
I would like to create a WordPress user from my Django web application. In Django, I have a User model, and I want to create a user on a WordPress site at the end of the save method. I found a solution on the web that looks like this: class User(models.Model): first_name = models.CharField(max_length=30, blank=True) last_name = models.CharField(max_length=30, blank=True) email = models.EmailField(unique=True) def save(self): ...some things... import requests username = self.email password = "f{wp_user_password}" api_url = f"my-wordpress-site/wp-json/wp/v2/users" data = { 'username': username, 'email': self.email, 'password': password } response = requests.post(api_url, json=data, auth=(username, password)) if response.status_code == 200: print("WordPress user created") However, when I try to execute this code, it raises a 401 error. How can I resolve this issue? -
Django Admin reverse inline many-to-many extremely slow to load
I have three models Organisation, Event and EventReport. Event and EventReport have a many to many relationship. An Event is only ever associated with a single Organisation. An Event may have many EventReports and a EventReport may be related to multiple Events. class Organisation(models.Model): ... name = models.TextField() url = models.URLField() ... class Event(models.Model): ... organisation = models.ForeignKey(Organisation, on_delete=models.CASCADE, related_name = "events") event_reports = models.ManyToManyField(EventReport, blank=True) ... class EventReport(models.Model): date = models.DateField() summary = models.TextField() My objective is to see all of the Events that a particular EventReport is linked to. This is a reverse Many-to-Many relationship, so I am using a "through" model. I've configured admin.py as follows: class EventInLine(admin.TabularInline): model = Event.event_reports.through class EventReportAdmin(admin.ModelAdmin): search_fields=['date','summary'] inlines = [ EventInLine, ] When loading an EventReport in Admin.. it works but takes an extremely long amount of time to load. The EventReport page does list multiple Events under a section called: "EVENT-EVENTREPORT RELATIONSHIPS" Each associated Event is represented in a single dropdown as a Event object e.g. event_event_reports object (10487) with the STR representation of each object in the dropdown. I believe the large amount of time is due to populating the dropdown box with every Event in the database … -
Filter the exact match from the django query set
I have gearbox_model values like this in the queryset in Django gearbox_model = 'XLG , 'SG' I have values arrays and I want to filter these values from the query set values = [ 'LG', SG'] So , I annotate the query set to create the gearbox_model_array queryset = queryset.annotate(gearbox_model_array=SplitComma("gearbox_model")) the gearbox_model_array becomes like this gearbox_model_array = [ 'XLG' , 'SG' ] Then I do filtering for value in values: queryset = queryset.filter(gearbox_model_contains=value) The issue is __contains returning the substring matches as well . For example the record gearbox_model_array = 'XLG , SG' returns as the substring 'LG' exist in it. I Also tried queryset = queryset.filter(gearbox_model_array__iexact=[value]) queryset = queryset.filter(gearbox_model_array__in=value) using the these above Got exception django.db.utils.DataError: malformed array literal: "LG" LINE 1: ...productmanagement_pump"."gearbox_model", ',') IN ('LG')) sub... -
Get session data from all connections in Django Channels
In my Django live time chat app I want to go through all the active connections and retrieve data stored inside request.session in each browser. I want to do this when a new connection to the web socket it made. For example say there is 3 active connections to the chat app; Chrome browser; session data - {'username':'Sam'} Chrome browser; session data - {'username';'James'} Firefox browser; session data - {'username':'Logan'} I want to get a list of all usernames on ChatComsumer.connect. How can I do this? consumers.py (connect method) class ChatComsumer(WebsocketConsumer): def connect(self): self.room_group_name = 'main' async_to_sync(self.channel_layer.group_add)( self.room_group_name, self.channel_name ) #GET ALL USERNAMES HERE. self.accept() -
Cpanel deployment of Django project getting 404 Not Found Error when entering any path besides just the domain
For the sake of the question, the domain of my site is domainname.com Typing in the domain into the web gets a functional page with loaded html and css. However, when I click on a button, for example, "Register", though the path changes to the correct corresponding path seen in urls.py on my code, instead of generating the corresponding view, I get a 404 notfound error. Here is what my urls.py looks like: urlpatterns = [ path("", views.home, name='home'), path("register/", views.register, name='register'), path("adgen/", views.IndexView.as_view(), name='index'), path('ad/create/', views.ad_create, name='ad-create'), path('ad/<int:pk>/', views.ad_detail, name='ad-detail'), ] I have also attached what the homepage looks like which is able to generate properly: When I enter just the domain- www.domainname.com, the page generates views.home properly However, when I enter anything past just the domain, such as www.domainname.com/register/, the page gives a 404 notfound error. On views.home, I can click a button called "Register" which brings me to the path www.domainname.com/register/ but gives a 404 notfounderror. I can edit urls.py (replacing "" with "hello/" in the first path), looking like the following: urlpatterns = [ path("hello/", views.home, name='home'), path("register/", views.register, name='register'), path("adgen/", views.IndexView.as_view(), name='index'), path('ad/create/', views.ad_create, name='ad-create'), path('ad/<int:pk>/', views.ad_detail, name='ad-detail'), ] and the path www.domainname.com/hello/ gets a … -
Uploading image to folder named by id of django object using api
I want uploaded files to be placed in folder named the id of an object. When I was doing sites by only using Django I did it like this: I want uploaded files to be placed in folder named the id of an object. When I was doing sites by only using Django I did it like this: def getImageURL(instance, filename): path = os.path.join("posts/{}/post_image.png".format(instance.id)) if os.path.isfile("media/" + path): print("image with this id already exist, ") os.remove("media/posts/{}/post_image.png".format(instance.id)) return path else: return path class Post(models.Model): author = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, ) title = models.CharField(max_length=200, default="no title") text = models.CharField(max_length=500) image = models.FileField(upload_to=getImageURL, blank=True, default="no-image.png") posted = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) It also works when I'm uploading an image using the admin panel. But when I'm doing the exact same thing through api, my images are being uploaded to folder named "None" which leads to overwriting the image after making a new post. -
Remove sidebar from django UI
Whenever the user clicks on models that are shown in the sidebar list, should navigate to that model's page and the sidebar should get removed(collapse). How can I achieve this? -
Registration in Django with sending by smtp qr code for 2fa
Threw django project on hosting, but no domain yet, front on react, run locally. The problem is that smtp does not send a letter to mail. Here are the settings EMAIL_USE_TLS = True EMAIL_PORT = 587 EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = config('EMAIL_HOST_USER') EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD') EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' views current_site = get_current_site(request) mail_subject = 'TOKEN' message = render_to_string('emails/account_activation_email.html', { 'user': user, 'qr_code': device.config_url, }) to_email = serializer.validated_data['email'] email = EmailMessage( mail_subject, message, to=[to_email] ) email.content_subtype = "html" email.send() I assume that the letter is not sent because there is no domain and protocol http, because locally everything worked. Maybe someone had such a problem, if the domain with ssl purchase it will pass ? -
Django, calling an event after StreamingHttpResponse is closed
Here is my code: def stream(self,request: HttpRequest,user,camera_index): try: url = self.config["cameras"][int(camera_index)]["url"] except IndexError or TypeError: return HttpResponseNotFound() response = StreamingHttpResponse(self.__stream(url),content_type="multipart/x-mixed-replace;boundary=frame") return response def __stream(self,url): video_cap = cv2.VideoCapture(url) while True: _, frame = cv2.imencode('.jpg', video_cap.read()[1],[int(cv2.IMWRITE_JPEG_QUALITY), 100]) yield(b'--frame\r\n' b'Content-Type: image/jpeg\r\n\r\n' + frame.tobytes() + b'\r\n\r\n') First, I want to know whether the __stream function is ended if user close the page. I did some tests about it but I am not sure. Second, can I add a callback to __stream function that will be called when streaming is closed? -
Django channels-redis WS
I have a problem with Redis WebSocket connection. I am using a server that prefers a unixsocket configuration. REDIS CONF FOR MY SERVER My files and sample template look like this: settings.py ASGI_APPLICATION = 'public_python.asgi.application' CHANNEL_LAYERS = { "default": { "BACKEND": "channels_redis.core.RedisChannelLayer", "CONFIG": { "hosts": [(("unix:///home/Temeria/domains/temeria.pl/redis.sock", 8560), {"password": "my_pass"})], }, }, } asgi.py import os from django.core.asgi import get_asgi_application from channels.auth import AuthMiddlewareStack from channels.routing import ProtocolTypeRouter, URLRouter import TableSG.urls # importuj swoje urlpatterns dla WebSocket z urls.py os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'public_python.settings') application = ProtocolTypeRouter({ "http": get_asgi_application(), "websocket": AuthMiddlewareStack( URLRouter( TableSG.urls.websocket_urlpatterns ) ), }) views.py def items_view(request): return render(request, 'TableSG/item.html') class ItemConsumer(AsyncWebsocketConsumer): async def connect(self): await self.accept() items = await self.get_items() await self.send(text_data=json.dumps(items)) @database_sync_to_async def get_items(self): items = SklepModel.objects.all().values() return list(items) urls.py from django.urls import path, include from . import views from django.conf import settings from django.conf.urls.static import static from django.contrib.auth import views as auth_views app_name = 'TableSG' urlpatterns = [ # other urls path('items/', views.items_view, name='items'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) websocket_urlpatterns = [ path('ws/items/', views.ItemConsumer.as_asgi()), ] template item.html {% extends "BaseSG/base.html" %} {% load static %} {% load crispy_forms_tags %} {% block content %} <ul id="items"> </ul> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script> var socket = new WebSocket('wss://' + window.location.host + '/ws/items/'); socket.onmessage = … -
Manually decorating function with extend_schema results in RecursionError
I have a HistoricalModelViewSet class which is used in all other view sets (class StuffViewSet(HistoricalModelViewSet)), it adds couple of /history endpoints (DRF thing, https://www.django-rest-framework.org/api-guide/viewsets/#marking-extra-actions-for-routing). Then I'm using drf-spectacular to generate a /swagger view, and there is a different structure to the /history endpoint than the rest of the view set. So I dynamically decorate the function with extend_schema using a serializer set in the child view: class HistoricalModelViewSet(viewsets.ModelViewSet): def __init__(self, **kwargs): self.list_history = extend_schema( responses={200: self.historical_serializer_class(many=True)}, )(self.list_history) @action(detail=False, methods=["get"], url_path="history", url_name="list-history-list") def list_history(self, request): serializer = self.historical_serializer_class(history_items, many=True, context=context) return Response(serializer.data) This all works fine, can view /history for all models. However when viewing /swagger everything works fine couple of times but then after about 5 reloads it errors with: myapp-api-1 | 2023-07-31 11:23:16,553 ERROR django.request log 2577 140001382692608 Internal Server Error: /myapp/schema/ myapp-api-1 | Traceback (most recent call last): myapp-api-1 | File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner myapp-api-1 | response = get_response(request) myapp-api-1 | File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response myapp-api-1 | response = wrapped_callback(request, *callback_args, **callback_kwargs) myapp-api-1 | File "/usr/local/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view myapp-api-1 | return view_func(*args, **kwargs) myapp-api-1 | File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 84, in view myapp-api-1 | return self.dispatch(request, *args, **kwargs) myapp-api-1 | File "/usr/local/lib/python3.10/site-packages/rest_framework/views.py", line … -
Python AES_GCM Encryption And Decryption
In Python have to do AES_GCM Encryption And Decryption and have to pass key (32 length of characters) , iv (16 length of characters) with ciphertext for decryption. I have tried lots of time but constant decryption error (on C#) is mac check in gcm failed. Tried GPT still error persists. C# code and Python are equivalent. Please Help! Thanks 🙏🙏 -
Why are my forms not saved in the Database
I want that when entering data into rows, when pressing the button, they are saved.But this is not happening.I'll attach my code. I would be very grateful if you would point out any more errors in my code. [models.py](https://i.stack.imgur.com/jupBK.png) [Forms.py](https://i.stack.imgur.com/v08eU.png) [today.html](https://i.stack.imgur.com/K1Lrw.png) [views.py](https://i.stack.imgur.com/ran58.png) -
How to show boolean field from django-restframework in react native
I am using the django rest-framework in combination with react-native. And I try to show a BooleanField in the react-native app. Django model looks: cites = models.CharField(max_length=5, choices=CitesChoices.choices, default=CitesChoices.EMPTY, verbose_name="Cites") uis = models.BooleanField(default=False, verbose_name="UIS") serializer: class SubAnimalSerializer(serializers.ModelSerializer): category = serializers.SlugRelatedField( slug_field='name', queryset=Category.objects.all() ) class Meta: model = Animal fields = ['id', "cites","uis" ] read_only_fields = ['id'] and react: /* eslint-disable prettier/prettier */ import React, { createContext, useState } from "react"; import { List } from "react-native-paper"; import { Text } from "react-native"; export const AccordionItemsContext = createContext(); export const AccordionItemsProvider = ({ children }) => { const [citesExpanded, setCites] = useState(false); const [UISExpanded, setUIS] = useState(false); const accordionItems = (item) => { return ( <> <List.Accordion title="Cites" expanded={citesExpanded} onPress={() => setCites(!citesExpanded)}> <Text>{item.cites}</Text> </List.Accordion> <List.Accordion title="UIS" expanded={UISExpanded} onPress={() => setUIS(!UISExpanded)}> <Text>{item.uis}</Text> </List.Accordion> </> ); }; return ( <AccordionItemsContext.Provider value={{ accordionItems, }}> {children} </AccordionItemsContext.Provider> ); }; And all properties are working(displayed): cites. Except the uis propertie. Question: how to show the BooleanField(uis) on the screen? -
Redirecting with base 64 encoded image throwing No reverse Match error
I have a base 64 image captured in the browser and sent to Django view for processing. I passed the image to the API and depending on the response, I want to redirect to another page with the base 64 image as parameter but it's generating an error. here is the codes. @login_required def snap_rider(request): if request.method == 'POST': base64 image``your text image = request.POST['photo_data'] #Calculate the size of the image in bytes image_size = len(image) * 3 / 4 if image_size > 5 * 1024 * 1024: return render(request, 'rider_management/snap-rider.html', {'error_message': 'Image size is too large. Please select a smaller image.'}) search_request_data = { "images": [image], "min_score": 0.7, "search_mode": "FAST" } response = requests.post(SEARCH_URL, json=search_request_data, headers=headers) if response.status_code == 200: data = response.json() if data == []: return redirect('create_rider', image=image) else: print(f"Error: {response.status_code} - {response.text}") return render(request, 'rider_management/snap-rider.html') The view I'm redirecting to: @login_required def create_rider(request): image = request.POST.get('image') the urls.py path('create-rider/', views.create_rider, name='create_rider'), -
Google Vertex AI Prediction API Authentication
I have written a Django-Web app that takes in user input from a ModelForm as a Python Dict, then passes into Django backend to make prediction with Google Vertex AI Prediction API, then return the prediction to the web frontend for user. I have obtained a Service Account Key (JSON) for getting the credentials needed. However I am still facing 401 Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential The same code worked initially dated in 14/7/2023, yet it stopped working as of two days ago. from google.oauth2 import service_account from google.cloud import aiplatform from google.protobuf import json_format from google.protobuf.struct_pb2 import Value def model_predict(json_data): key_path = 'path-to-service-account-key.json' # Create a credentials object using your service account key file credentials = service_account.Credentials.from_service_account_file( key_path, scopes=['https://www.googleapis.com/auth/cloud-platform'] ) # Deployed Endpoint model configs project_id = "project_id" endpoint_id = "endpoint_id" instance_dict = json_data location = "us-central1" api_endpoint = "us-central1-aiplatform.googleapis.com" # The AI Platform services require regional API endpoints. client_options = {"api_endpoint": api_endpoint} # Initialise client that will be used to create and send requests. client = aiplatform.gapic.PredictionServiceClient(credentials=credentials, client_options=client_options) # Pass required configs and instance into AI Client instance = json_format.ParseDict(instance_dict, Value()) instances = [instance] parameters_dict = … -
Python Django Forms how to create object using multiple sub-objects?
I'm trying to create form that will allow me to create Meal object using multiple MealItem sub-objects which also have parameter of quantity, however up to this point I was able to create form and view combination that will allow me either to pick only one sub-object with one quantity Models: class Meal(models.Model): name = models.CharField(max_length=200) user = models.ForeignKey(User, on_delete=models.CASCADE) image = models.ImageField(upload_to=meal_image_upload_to, blank=True, null=True) def calculate_total_macros(self): total_kcal = 0 total_carbohydrates = 0 total_fats = 0 total_proteins = 0 total_glycemic_load = 0 total_glycemic_index = 0 total_weight = 0 weighted_glycemic_index = 0 meal_items = self.mealitem_set.all() for meal_item in meal_items: quantity = meal_item.quantity food_item = meal_item.food_item total_weight += quantity total_kcal += food_item.kcal * quantity/100 #food items have nutrition facts per 100g total_carbohydrates += food_item.carbohydrates * quantity/100 total_fats += food_item.fats * quantity/100 total_proteins += food_item.proteins * quantity/100 total_glycemic_load += food_item.glycemic_load * quantity/100 total_glycemic_index += food_item.glycemic_index weighted_glycemic_index += food_item.glycemic_index * quantity if total_weight != 0: total_kcal_per_100g = round((total_kcal / total_weight) * 100, 2) total_carbohydrates_per_100g = round((total_carbohydrates / total_weight) * 100, 2) total_fats_per_100g = round((total_fats / total_weight) * 100, 2) total_proteins_per_100g = round((total_proteins / total_weight) * 100, 2) total_glycemic_load_per_100g = round((total_glycemic_load / total_weight) * 100, 2) else: total_kcal_per_100g = 0 total_carbohydrates_per_100g = 0 total_fats_per_100g = … -
python's django is having problems, but I don't know why and how to fix it
enter image description here enter image description here enter image description here I modified the variable according to chatgtp's suggestion, but I still don't understand what it means and the correct solution,I hope someone can give me some concrete steps -
Preprocessing Engine in Django
I'm developing a web application of Preprocessing engine in django. Basically, I want to provide an interface to user where user can upload their csv files to database. There should be a drop drown where user can see all their uploaded csv files. When the user selects any csv file from the menu, the corresponding data of that file will be shown. Also I want to provide some data cleaning and preprocessing methods to user like dropping columns, dropping and imputing null values, forward and reverse geocoding , binning etc. I want a little guidance about the approach of doing this project like a workflow of the application. I have studied numerous threads and articles but could not find anything relevant. The one approach I am trying is: The user uploads the csv file and the file is uploaded in file format in the database and I am reading that file using pandas and passing it to template in html format. Is that a correct approach? Any guidance, tips, recommendations will be appreciated. -
How to rename a file in Azure File Share using Azure Python SDK?
I am trying to rename a file in Azure File Share using the Azure python SDK. But the problem I'm facing is, it removes the file instead of renaming it. with directory_client.get_file_client(file_name=project_from_db.project_name) as rename_client: rename_client.rename_file(new_name=new_data['project_name']) Is anything wrong here? -
Django Channels : TypeError( TypeError: ProactorEventLoop is not supported, got: <ProactorEventLoop running=False closed=False debug=False>
I was trying to copy the tutorial in Django Channels Documentation. I am using Django 2.2.19 and Channels 2.1.2 But I'm having errors. It says File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\twisted\internet\asyncioreactor.py", line 61, in init raise TypeError: ProactorEventLoop is not supported, got: -
How to revoke the JWT 'access token' in Django?
Is there any way to revoke the JWT access token in Django? (currently, I am using the rest_framework_simplejwt, and I want to write the logout view) Is adding the access token(revoked ones) to a database table a good idea? There is a way to revoke the 'refresh token' in simplejwt docs, But I have not found anything about revoking 'access token' in simplejwt docs.