Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django-plolty-dash errors: for ImportError: Can't import 'Dash' from 'dash'
Python version: 3.7.9 Django version: 3.1.1 django_plotly_dash: 1.4.2 I have tried to install dash_plotly_dash package after I tested the Django project could work properly. That is to say, the development server works fine and the webpage can be opened without problems. However, after I install the dash_plotly_dsah package and add the following to the project settings: INSTALLED_APPS = [ ... 'django_plotly_dash.apps.DjangoPlotlyDashConfig', ... ] Immediately, I had an error ImportError: cannot import name 'Dash' from 'dash' (project\app_init_.py) -
A field in my Django model already exists in the PostgreSQL database
I have a Django app with a model MyModel and some field my_field. My PostgreSQL database already has a field of that name under the mymodel table, since it was added manually in the past. When I make migrations, Django generates an AddField operation, which is in conflict. Currently I manually edit every generated migration to remove the conflict. Is there a way to tell Django that the field already exists? Unfortunately this is a live product, so I cannot lose any data. -
Django Football Simulation - Getting "too many redirects" warning when looping through views
I have a list of 16 games to simulate for Week 1 of this football simulation. I have a VIEW called "simulate_game" that kicks off simulation of the first game in the list using list index=0 (redirecting to some other views, html templates in the process), adds 1 to the index variable, and then redirects back to the "simulate_game" view in order to simulate game #2, and so on and so forth. When testing, i keep getting "too many redirects" warnings. Is there a better way to loop through data than this? I've been searching the internet for a while now with no luck. I feel like there is some fundamental concept that i'm unaware of. Thanks! -
Django REST Framework dynamic forms generation
I am using Django REST Framework as my API for a React frontend. I have forms that are dynamically created by the user. A bit like Google Forms. I am having trouble setting up the models for this. For Example, the user wants a CharField, a SelectField, and a Checkbox. I should return a JSON Object representing the fields with their types and attributes like "required", "options" (for a selectfield), etc. As I said, it is like Google Forms. How do I go about this? -
Set up two media directories
I am doing Django project. I installed django-watermark from PyPI to make watermarks on my pictures. Here you see my media directory, when pictures are uploaded to django, they appear in Media root. Next, watermark library grabs those pictures, adds watermarks and drops them to "watermarked" folder. Eventually, pictures have to be fetched from "watermarked" directory. Website works perfectly when debug=True, however on my server (I use AWS, IIS Windows for hosting), when I set debug=False, instead of pictures I get 404 error. My virtual directory for IIS is set to be my Media root directory these are my settings and url files -
Django ORM getting cx_Oracle.DatabaseError: ORA-00933: SQL command not properly ended
I've got class in models: class Region(models.Model): region_id=models.AutoField(primary_key=True,db_column="region_id") region_name=models.CharField(max_length=4000,blank=True,db_column="region_name") def __str__(self): return f"region_id={self.region_id}, region_name={self.region_name}" class Meta: db_table = "regions" Now I'm trying to query database from shell: python manage.py shell >>>s=Region.objects.all() >>>s When I'm connected to PostgreSQL everything is fine, but when I connect to Oracle (has same table) I'm getting "cx_Oracle.DatabaseError: ORA-00933: SQL command not properly ended" doing the same as with PostgreSQL. Is there some bug in cx_Oracle or what? Please help, I spent few hours on that issue. -
How to resolve: TypeError: __init__() got an unexpected keyword argument 'max_Length' I've tried everything
Here's another similar question that didn't worked for me even it's almost the same situation How to resolve TypeError: __init__() got an unexpected keyword argument '_MAX_LENGTH' in Django from django.db import models import string import random def generate_unique_code(): lenght = 6 while True: code = ''.join(random.choices(string.ascii_uppercase, k=lenght)) if Room.objects.filter(code=code).count() == 0: break return code # Create your models here. class Room(models.Model): code = models.CharField(max_Length=8, default="", unique=True) host = models.CharField(max_Length=50, unique=True) guest_can_pause = models.BooleanField(null=False, default=False) votes_to_skip = models.IntegerField(null=False, default=1) created_at = models.DateTimeField(auto_now_add=True) -
Django: How to search through django.template.context.RequestContext
I'm working over tests in Django and faced <class 'django.template.context.RequestContext'>, which I'm trying to iterate through and find <class 'ecom.models.Product'> object inside. test.py def test_ProductDetail_object_in_context(self): response = self.client.get(reverse('product_detail', args=[1])) # assertEqual - test passes self.assertEqual(response.context[0]['object'], Product.objects.get(id=1)) # assertIn - test fails self.assertIn(Product.objects.get(id=1), response.context[0]) views.py class ProductDetailView(DetailView): model = Product def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) data = cartData(self.request) cartItems = data['cartItems'] context['cartItems'] = cartItems return context What's inside response.context: [ [ {'True': True, 'False': False, 'None': None}, {'csrf_token': <SimpleLazyObject: <function csrf.<locals>._get_val at 0x7fd80>>, 'request': <WSGIRequest: GET '/1/'>, 'user': <SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x7fd820>>, ' perms': <django.contrib.auth.context_processors.PermWrapper object at 0x7fd80>, 'messages': <django.contrib.messages.storage.fallback.FallbackStorage object at 0x7fd8290>, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'SUCCESS': 25, 'WARNING': 30, 'ERROR': 40} }, {}, {'object': <Product: Pen>, 'product': <Product: Pen>, 'view': <ecom.views.ProductDetailView object at 0x7fd8210>, 'cartItems': 0} ], [ {'True': True, 'False': False, 'None': None}, {'csrf_token': <SimpleLazyObject: <function csrf.<locals>._get_val at 0x7fd8240>>, 'request': <WSGIRequest: GET '/1/'>, 'user': <SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x7fd8250>>, 'perms': <django.contrib.auth.context_processors.PermWrapper object at 0x7fd8250>, 'messages': <django.contrib.messages.storage.fallback.FallbackStorage object at 0x7fd8290>, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10, 'INFO': 20, 'SUCCESS': 25, 'WARNING': 30, 'ERROR': 40} }, {}, {'object': <Product: Pen>, 'product': <Product: Pen>, 'view': <ecom.views.ProductDetailView object at 0x7fd8210>, 'cartItems': 0} ] ] Type of response.context: <class 'django.template.context.RequestContext'> What's inside Product.objects.get(id=1) … -
Notifications system for User into ManytoMany field
I got an issue I was wondering is there is a way to send a notification from Many to Many to each new user who are integrated to Reservation (notification has to be sent only to new users who belongs to friends). At the Reservation creation, friends == Null and then admin can add some user. Does anyone has an idea about how I can manage to do it? Assume user == reservation admin and friends are user who can only have access to the reservation. class Reservation(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE) friends = models.ManyToManyField(User,blank=True,related_name='friends_reservation') def notifs_reservation(sender, instance, *args, **kwargs): reservation = instance sender = reservation.user n_seller = reservation.friends notify = Notification(reservation=reservation, sender=sender, user=n_seller, notification_type=7) notify.save() send_mail( subject = "Lorem", message = render_to_string('notifs_reservation.html', { 'sender': reservation.user, 'n_userb': n_seller, 'channel': reservation.slug, }), from_email="example@example.co", recipient_list=[n_seller.email] ) post_save.connect(notifs_reservation, sender=Reservation) -
get_context_data method doesn't work in django
I have a class based view that inherits from CreateView and I have some fields that I want to be sent in the page through context dictionary and the get_context_data doesn't work because non of the context fields doesn't appear in the page. the class: class IncomeCreateListView(CreateView): template_name = 'users/incomes_&_spendings.html' form_class = IncomeCreateForm def get_context_date(self, **kwargs): context = super().get_context_data(self, **kwargs) incomes = Incomes.objects.filter( user=self.request.user, created_date__year=datetime.now().year, created_date__month=datetime.now().month) if datetime.now().month == 1: incomes_last_month = Incomes.objects.filter( user=self.request.user, created_date__year=datetime.now().year - 1, created_date__month=datetime.now().month + 11) else: incomes_last_month = Incomes.objects.filter( user=self.request.user, created_date__year=datetime.now().year, created_date__month=datetime.now().month - 1) total_incomes = round(assembly(incomes), 2) total_incomes_last_month = round( assembly(incomes_last_month), 2) context['title'] = 'Incomes' context['object_name'] = 'Incomes' context['primary_color'] = 'primary' context['objects'] = incomes context['total_sum'] = total_incomes context['total_sum_last_month'] = total_incomes_last_month context['year'] = datetime.now().year, context['month'] = datetime.now().month, return context def form_valid(self, form): return super().form_valid(form) -
Download zip file with Django from API request
Currently, I am making a call to an API that sends back a zip file. When using request: res = requests.get('http://url/to/api, headers={auth: 'token', Accept: 'application/octet-stream'} I am able to get the binary response content using res.content: Example: b'PK\x05\x06\... Then I return the binary response from my view to my template: return render(request, 'example.html', {'zipfile': res.content} At my example.html, I tried to create a button to download the zip file using: <a href="data:application/zip, {{ zipfile }}" download>Download</a> However, I got back a corrupted zip file. I'm quite new to Django, any help here is appreciated, thanks! -
"Send to messenger" Plugin not showing
I stuck at the "send to messenger" plugin, my configs as follow: My page: <body> <script> window.fbAsyncInit = function () { FB.init({ xfbml: true, version: 'v9.0' }); FB.Event.subscribe('send_to_messenger', function (e) { console.log(e); }); }; (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js'; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <div class="fb-send-to-messenger" messenger_app_id="XXXX" page_id="XXXX" data-ref="anything" color="blue" size="large"> </div> </body> I added my webhook to the whitelist The Django server implementation: class MyBot(generic.View): # verify Facebook token def get(self, request, *args, **kwargs): return HttpResponse(verify_fb_token(self.request.GET['hub.verify_token'], self.request.GET['hub.challenge'])) # The dispatch method for attempting to delegate to a method that matches the HTTP method def dispatch(self, request, *args, **kwargs): return generic.View.dispatch(self, request, *args, **kwargs) # Post function to handle messages def post(self, request, *args, **kwargs): # Converts the text payload into a python dictionary incoming_message = json.loads(self.request.body.decode('utf-8')) for entry in incoming_message['entry']: for message in entry['messaging']: print(message) if 'message' in message: try: if 'quick_reply' in message['message']: pass... except Exception as e: print(e) return HttpResponse() I allowed the cookies I tried everything in production (using Heroku and ngrok) There is something I missed? -
Django Admin - Create Custom List
I want to create a custom admin view. It should list specific objects from a model and add attributes to it. More precisely, I have the tables Student and Lecture. Lecture has an attribute enrolled_students, which is a Many-to-Many relationship (Student can be enrolled in multiple lectures; a lecture can have many enrolled Students). Students can gain points in a lecture, which determines their grade. Therefore, I would like to provide an admin view, in which all students of a specific lecture are listed, along with their reached points and grade. The grade is computed lazily, as points are changing frequently. How can I implement this? Is this possible using the build-in methods? Thanks a lot! -
Mime Type error from AWS Elastic Beanstalk
I deployed my django project to aws elastic branstalk. I followed all the steps. In EBS console, project health seems Ok. When I try to run the project, I get the following error. `Refused to apply style from '' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. Here is my css and js addresses: <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" /> <script src="{%static 'js/jquery.min.js'%}"></script> How can I fix this issue? -
django: app crashed heroku[router]: at=error code=H10 desc="App crashed"
I am trying to host my first Django app on Heroku. But it is crashing and app isn't starting. Showing application error. I tried so many different ways but nothing is working at all. I also delete my .git folder and push many times, again crashing. Here is my log file. In the last line of the log file, you can see the error message. Can anyone help me why my app is crashing and how to fix it? Thanks in advance. user@Ubuntu:~/Documents/Webdev/PyShop$ heroku logs --tail › Warning: heroku update available from 7.47.6 to 7.47.7. 2021-01-08T14:12:50.803403+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application 2021-01-08T14:12:50.803403+00:00 app[web.1]: return WSGIHandler() 2021-01-08T14:12:50.803403+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 127, in __init__ 2021-01-08T14:12:50.803404+00:00 app[web.1]: self.load_middleware() 2021-01-08T14:12:50.803404+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/core/handlers/base.py", line 40, in load_middleware 2021-01-08T14:12:50.803405+00:00 app[web.1]: middleware = import_string(middleware_path) 2021-01-08T14:12:50.803405+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/django/utils/module_loading.py", line 17, in import_string 2021-01-08T14:12:50.803406+00:00 app[web.1]: module = import_module(module_path) 2021-01-08T14:12:50.803406+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module 2021-01-08T14:12:50.803407+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level) 2021-01-08T14:12:50.803407+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import 2021-01-08T14:12:50.803407+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load 2021-01-08T14:12:50.803408+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked 2021-01-08T14:12:50.803408+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed 2021-01-08T14:12:50.803408+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line … -
Django Adding Random String In Static File Names
I have a Django (Wagtail CMS) website deployed using Apache WSGI. For some reason, the static files linked in the page source code is wrong. For example, the page's styling doesn't work because the page's HTML comes up as: <link rel="stylesheet" type="text/css" href="/static/css/styles.d0720c096b01.css"> The link /static/css/styles.d0720c096b01.css leads to a 404, but if I browse to /static/css/styles.css I can see my stylesheets. The random string d0720c096b01 is being added to all the static files. How do I fix this? -
DRF OpenAPI documentation omitting nested endpoints
In urls.py I specify a number of URLs. But only those with only one slash-separated "word" beyond api/ are actually included in the schema. E.g. an openapi schema generated from the code below will only document the /api/token/ endpoint. The (deprecated) corejson schema does include them. Is this because my endpoints are not OpenAPI compliant? urls.py urlpatterns = [ path("api/token/", auth_user_views.AuthUserView.as_view(), name="auth_user"), path( "api/token/refresh/", auth_user_views.AuthUserRefreshView.as_view(), name="token_refresh", ), url( r"^api/token/verify/$", jwt_views.TokenVerifyView.as_view(), name="token_verify" ), ] -
Django_filter: How to specify the fields from a Foreign Key using Multiple choice filter?
I have a database (django model) containing DNA sequences with certain informations (not relevant here) which are associated with a Foreign Key (species name)to species informations. I want to research the sequences via the species name using django_filter MultipleChoiceFilter. the problem is: the choices which appear to the users are the species id not the species name. I tried to define a custom class to only display species name however it does not change anything. Maybe I should specify something in the init() function ? Thank you for your help. Here are my models: Class Especes(models.Model): nom_espece = models.CharField(max_length=100,unique=True) famille = models.CharField(max_length=100) ordre = models.CharField(max_length=100) classe = models.CharField(max_length=100) embranchement = models.CharField(max_length=100) regne = models.CharField(max_length=100) pays = models.CharField(max_length=100) class Meta: verbose_name = 'especes' def _str_(self): return self.nom_espece class Sequences(models.Model): numero_sequence = models.IntegerField() sequences = models.CharField(max_length=1000000) gene = models.CharField(max_length=100) nombre_pdb = models.IntegerField()#check how to limit integer field ?? amorces = models.CharField(max_length=1000) espece=models.ForeignKey(Especes,on_delete=models.CASCADE,related_name='liste_sequence',default=None) auteurs = models.CharField(max_length=100) annee_publication = models.IntegerField() groupe_recherche = models.CharField(max_length=100) institut = models.CharField(max_length=100) class Meta: verbose_name = 'numero_sequence' def _str_(self): return self.gene` Here is my filters.py file: `class MyMultipleChoiceFilter(django_filters.ModelChoiceFilter): def label_from_instance(self, obj): return obj.nom_espece class SequencesFilter(django_filters.FilterSet): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) espece = MyMultipleChoiceFilter(queryset=Especes.objects.all(),label='Species') class Meta: model = Sequences fields … -
javascript file loading problem in a web browser, relating to mime types, context Django debug_toolbar concerning Django/debug_toolbar versions >=3.X
I have noticed, at some point last year, that the debug_toolbar is not present anymore. Now I have found the problem, but do not actually completely understand what is happening and why. The initial information is that I tried a lot of different version combinations for Django/delug_toolbar and there were no problems as the version number of both started by 2. However, the toolbar is not showing itself if a version number starts by 3. The toolbar 2.2 should work with Django version 3 or larger also. Now I have located the problem to be that toolbar.js is not loaded. There is a message in the developer tool's console: :8001/static/debug_toolbar/js/toolbar.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec. So I found the location of the toolbar.js under the static files folder of the debug_toolbar. The file is loaded in a template base.html (in folder env\Lib\site-packages\debug_toolbar\templates\debug_toolbar) There is a line: <script type="module" src="{% static 'debug_toolbar/js/toolbar.js' %}" async></script> I changed it to be: <script type="application/javascript" src="{% static 'debug_toolbar/js/toolbar.js' %}" async></script> And the change I made is quite obvious. But I do not understand … -
Django/HTML: Pre-populating "number" input fields with decimal values from a model
I'm writing code for editing infos about a product an user has already saved in our database. So I want to pre-populate the fields of the form with the 'old' infos. Everything works fine except for the prices that I can't get to be displayed. I understand that the problem is related to the decimals since the "weight" field (whole numbers) works fine. Here's the context in my view function (working fine, I can print the prices values on the console): context["old_title"] = selected_product.title context["old_weight"] = selected_product.weight context["old_dayprice"] = selected_product.price_day_tvac context["old_weekendprice"] = selected_product.price_weekend_tvac context["old_weekprice"] = selected_product.price_week_tvac context["old_monthprice"] = selected_product.price_month_tvac context["old_description"] = selected_product.text Here's the HTML input: <div class="col-md-3 multi-horizontal" data-for="dayprice"> <div class="form-group" data-children-count="1"> <label class="form-control-label display-7 font-weight-bold" for="website" >€ / day </label > <input type="number" class="form-control" name="dayprice" data-form-field="Dayprice" id="dayprice" placeholder="5" step="any" min="0" value= "{{ old_dayprice }}" /> <p class="font-italic font-weight-light"></p> </div> and here's the model's concerned fields: price_day_tvac = models.DecimalField(verbose_name="DAY - Medium season", default=0, max_digits=9, decimal_places=2) price_week_tvac = models.DecimalField(verbose_name="WEEK - Medium season", default=0, max_digits=9, decimal_places=2) price_weekend_tvac = models.DecimalField(verbose_name="WEEKEND - Medium season", default=0, max_digits=9, decimal_places=2 price_month_tvac = models.DecimalField(verbose_name="MONTH - Medium season", default=0, max_digits=9, decimal_places=2) I tried changing the 'steps'(do different values, 'any', removing it), placing a hard-coded value (with decimal or … -
Django-tenants error redirecting to correct tenant/schema
First, I'm not sure if it's a problem of the package itself or something that I'm doing wrong (I guess it's the second option). I followed all the instructions of documentation (here https://django-tenants.readthedocs.io/en/latest/use.html) and even tho I can't figure out what I'm doing wrong. I have a app 'costumers' which is held my tenant model. This app is on 'SHARED_APPS' right under 'django_tenants'. My app 'university' is on 'TENANT_APPS'. This app contains all the logic and it has my models.py. I managed to create tenants correctly, BUT, the problem occurs when I try to use any of my Api endpoints. Example: I created a tenant called university1 and this tenant has it's own schema on my PostgreSQL database. When I do a post request using an api (using this tenant 'university1'), django is trying to use a table which doesn't exist on my schema. I really don't know what I'm doing wrong. In my models.py (in my app 'university'), do I have to add anything there? For example class Meta: managed = False and db_table=name_of_table_on_database? This is a sample of it: from django.db import models from comum.models import * from datetime import datetime from django.utils.translation import gettext_lazy as _ from … -
Controlling access to HTTP API with Django as issuer
I have Django GraphQL deployed to AWS Lambda + API Gateway using the serverless framework. For authentication I have used the django-graphql-jwt package. It is working perfectly fine using the provided queries. I would like to move to the new API Gateway HTTP API as I only proxy traffic. I was wondering if there is any advantage of validating the provided token at the API Gateway level? If so, is there any way I can achieve that by defining django with this package as the issuer? -
Using Different Redis Database for Different Queues in Celery
I have a Django application that uses Celery with Redis broker for asynchronous task execution. Currently, the app has 3 queues (& 3 workers) that connect to a single Redis instance for communication. Here, the first two workers are prefork-based workers and the third one is a gevent-based worker. The Celery setting variables regarding the broker and backend look like this: CELERY_BROKER_URL="redis://localhost:6379/0" CELERY_RESULT_BACKEND="redis://localhost:6379/1" Since Celery uses rpush-blpop to implement the FIFO queue, I was wondering if it'd be correct or even possible to use different Redis databases for different queues like — q1 uses database .../1 and q2 uses database .../2 for messaging? This way each worker will only listen to the dedicated database for that and pick up the task from the queue with less competition. Does this even make any sense? If so, how do you implement something like this in Celery? -
Page not found (Django)
I'm making website using Python Framework of 'Django'. I have some problems with Django about entering. The page for http://127.0.0.1:8000/blog/archive/2021/1%EC%9B%94/ should be uploaded when the January link is clicked, otherwise Page not found (404) will appear. I'd like to know what's wrong and how to fix it. project/urls.py contains: """mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.1/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from bookmark.views import BookmarkListView, BookmarkDetailView urlpatterns = [ path('admin/', admin.site.urls), path('bookmark/', include('bookmark.urls')), path('blog/', include('blog.urls')), ] blog/urls.py contains: from django.urls import path, re_path from blog import views app_name='blog' urlpatterns = [ # Example: /blog/ path('', views.PostListView.as_view(), name='index'), # Example: /blog/post/ (same as /blog/) path('post/', views.PostListView.as_view(), name='post_list'), # Example: /blog/post/django-example/ re_path(r'^post/(?P<slug>[-\w]+)/$', views.PostDetailView.as_view(), name='post_detail'), # Example: /blog/archive/ path('archive/', views.PostArchiveView.as_view(), name='post_archive'), # Example: /blog/archive/2019/ path('archive/<int:year>/', views.PostYearArchiveView.as_view(), name='post_year_archive'), # Example: … -
Sentry Performance Monitoring for Django per Request
I have set up performance monitoring for Django using sentry_sdk package, by default it sends one transaction(unit of monitoring) to my server per each celery task, is there an easy way to do it for each request? In the docs, it said that this is the default behavior for flask apps.