Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django: catch database integrityerror
I have a model with a unique field - something like: class UniquePerson(models.Model): name = models.CharField(max_length = 100, unique=True) ... The user can submit new persons; if the name already exists we should just return an error message - i.e. a view like this: def add_person(request, name): try: person = UniquePerson.objects.create(name = name) return HttpResponse(f"New person with name: {name} added") except ????? return HttpResponse(f"Error: person with name: {name} already registered in DB") But - I can not seem to catch the IntegrityError from the database when I try to add a name which already exists in the database? What is the idiomatic way to handle this situation? -
Django - How to disable syntax suggestion in VSCode?
Hello friend does anyone know how to disable this type of suggestion in VSCode? It always gives me "-> HttpResponse" (shadow-suggestion). It makes me confused sometimes -
how to read <class 'django.core.files.uploadedfile.InMemoryUploadedFile'> file using gencache.EnsureDispatch("Excel.Application")
I have been trying to read inmemory file using win32com.client named EnsureDispatch. but it gives error like this "pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft Excel', "Sorry, we couldn't find QUANDA_USER_TEMPLATE_ver2.0.xlsx. Is it possible it was moved, renamed or deleted?", 'xlmain11.chm', 0, -2146827284), None)". But if I give the proper local file path then it is able to read. from win32com.client import Dispatch, gencache import pythoncom import time import os import io pythoncom.CoInitialize() myxlsx = gencache.EnsureDispatch("Excel.Application") myxlsx.Visible = 1 myxlsx.Workbooks.Open(tmp_file) # tmp_file is the InMemoryUploadedFile which is uploaded by django rest # #framework api above code is giving error as mentioned above. but if i give the local file path then it works fine as below local_path = "myexcel.xlsx" myxlsx.Workbooks.Open(local_path) now I dont want to save file in my local as there will be 100th s of users who will be uploading the file. how can I read that inmemory file using win32.com. please help if any better solution is available. Thanks in advance. -
Django custom-user error: HINT: Add or change a related_name argument to the definition for 'custom_auth.CustomUser.groups' or 'auth.User.groups'
I need help. I'm creating an registration/login app in Django and I'm having some trouble making migrations of my CustomUser class. Below is the error: SystemCheckError: System check identified some issues: ERRORS: auth.User.groups: (fields.E304) Reverse accessor 'Group.user_set' for 'auth.User.groups' clashes with reverse accessor for 'custom_auth.CustomUser.groups'. HINT: Add or change a related_name argument to the definition for 'auth.User.groups' or 'custom_auth.CustomUser.groups'. custom_auth.CustomUser.groups: (fields.E304) Reverse accessor 'Group.user_set' for 'custom_auth.CustomUser.groups' clashes with reverse accessor for 'auth.User.groups'. I tried adding a related name as was a suggestion to a similar question here, but it still throws the same error when I makemigrations. The code for my models.py is as below: # custom_auth/models.py from django.contrib.auth.models import AbstractUser from django.db import models # Create your models here. class CustomUser(AbstractUser): phone_number = models.CharField(max_length=15) designation = models.CharField(max_length=100) # Add a related_name to the user_permissions field user_permissions = models.ManyToManyField( to='auth.Permission', related_name='custom_users', blank=True, ) -
Problem while using django Prefetch object
In my django application I have three models that are class Restaurant(models.Model): class TypeChoices(models.TextChoices): INDIAN = 'IN','Indian' CHINESE = 'CH','Chinese' ITALIAN = 'IT','Italian' GREEK = 'GR','Greek' MEXICAN = 'MX','Mexican' FASTFOOD = 'FF','Fast Food' OTHERS = 'OT','Other' name = models.CharField(max_length=100,validators=[validate_name]) website = models.URLField(default='') date_opened = models.DateField() latitude = models.FloatField( validators=[MinValueValidator(-90),MaxValueValidator(90)] ) longitude = models.FloatField( validators=[MinValueValidator(-180),MaxValueValidator(180)] ) restaurant_type = models.CharField(max_length=2,choices=TypeChoices.choices,default='') def __str__(self): return self.name class Rating(models.Model): user = models.ForeignKey(User,on_delete=models.CASCADE) restaurant = models.ForeignKey(Restaurant,on_delete=models.CASCADE,related_name='ratings') rating = models.PositiveSmallIntegerField( validators=[MinValueValidator(1), MaxValueValidator(5)] ) class Sale(models.Model): restaurant = models.ForeignKey(Restaurant,on_delete=models.SET_NULL,null=True, related_name='sales') income = models.DecimalField(max_digits=8,decimal_places=2) datetime = models.DateTimeField() I want to get total sales of all restaurant within a month which have five star rating My view is like this def index(request): month_ago = timezone.now() - timezone.timedelta(days=30) monthly_sales = Prefetch('sales',queryset=Sale.objects.filter(datetime__gte=month_ago)) restaurant = Restaurant.objects.prefetch_related('ratings',monthly_sales).filter(ratings__rating=5).annotate(total=Sum('sales__income')) context = {'restaurants':restaurant} return render(request,'index.html',context) Template I used is {% for restaurant in restaurants %} <p>{{restaurant.name}} - {{restaurant.total}}</p> {% endfor %} The problem her is I'm getting sales before one month. I want only the sales within a month. -
How to creat & deploy react & django project to Elastic Beanstalk?
I want to creat a web application using React as frontend & Djanog as backend, and deploy that web application to Elastic Beanstalk. What should I do (separate frontend from backend folder?) to make Easy deployment to Elastic Beanstalk. I don't find any resource that provide step by step on deployment of React & Django to Elastic Beanstalk. -
ReactJS. I can't submit image through Axios to Django Rest Framework
I really need your help. I'm trying to send image through Axios to Django Rest Framework field for my project but I'm always facing this error 'The submitted data was not a file. Check the encoding type on the form.' Here my code : models.py from django.db import models from django.db.models.signals import post_save from django.contrib.auth.models import AbstractUser class User(AbstractUser): pictureImage = models.ImageField(blank=True,null=True, verbose_name="pictureImage") serializer.py from api.models import User from django.contrib.auth.password_validation import validate_password from rest_framework_simplejwt.serializers import TokenObtainPairSerializer from rest_framework import serializers from rest_framework_simplejwt.serializers import TokenObtainPairSerializer import base64 from uuid import uuid4 from django.core.files.base import ContentFile class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('id', 'pictureImage') class MyTokenObtainPairSerializer(TokenObtainPairSerializer): @classmethod def get_token(cls, user): token = super().get_token(user) return token class RegisterSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('id','pictureImage') def create(self, validated_data): user = User.objects.create( pictureImage=validated_data['pictureImage'] ) user.save() return user views.py from django.shortcuts import render from api.models import User from api.serializer import MyTokenObtainPairSerializer, RegisterSerializer from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework_simplejwt.views import TokenObtainPairView from rest_framework import generics from rest_framework.permissions import AllowAny from rest_framework.decorators import api_view class MyTokenObtainPairView(TokenObtainPairView): serializer_class = MyTokenObtainPairSerializer class RegisterView(generics.CreateAPIView): queryset = User.objects.all() permission_classes = (AllowAny,) serializer_class = RegisterSerializer @api_view(['GET']) def getRoutes(request): routes = [ '/api/token/', '/api/register/', '/api/token/refresh/' … -
why def delete(self, *args, **kwargs): method is not working in django
I have a Django model named Dates with a custom delete method as follows: from django.utils import timezone class Dates(models.Model): date = models.DateField() class Meta: verbose_name_plural = "Date" def delete(self, *args, **kwargs): if self.date < timezone.now().date(): super().delete() Could someone please help me understand why my custom delete method is not working as intended and how to make it work correctly to prevent the deletion of instances with past dates? or is this method only working in deployement? my timezone in settings.py LANGUAGE_CODE = 'en-us' TIME_ZONE = 'Asia/Kolkata' USE_I18N = True USE_TZ = True Thank you -
Is there a way to find all models that contain a GenericRelation to a particular model in Django?
Lets say we have the following model with a GenericForeignKey class Comment(models.Model): customer_visible = models.BooleanField(default=False) comment = models.TextField() content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField() model = GenericForeignKey() And in several places it is referenced in other models: class Invoice(models.Model): ... comments = GenericRelation(Comment) ... class Contract(models.Model): ... comments = GenericRelation(Comment) Is it possible to get a list of the types that reference the Comment model? e.g. [Contract,Invoice] in this example? Similar functionality is possible in for instance C# with Reflection. I need something that will work when there are no references already, so Comment.objects.values('content_type') won't work. -
Which update method to override? in the mixin or the serializer?
While I am working on a project I find myself need to add some logic in the update of some entity in my model, but I don't know whether to add this logic in the update method in the UpdateModelMixin or the update method in the ModelSerializer. What is the difference between them? I searched everywhere and didn't find any specific or general answer to that question -
Dockerize Django Websocket Url not found
I have a project with Django using Websocket and I'm using a docker. I have configuration named local.yml and used uvicorn and channels. When I started to build my docker, the http request works fine but my websocket urls is not found 404 error. Here is my local.yml: version: "3" services: django: &django build: context: . dockerfile: ./compose/local/django/Dockerfile image: api_local_django container_name: api_local_django platform: linux/x86_64 restart: always depends_on: - postgres - redis volumes: - .:/app env_file: - ./.envs/.production/.django - ./.envs/.local/.postgres ports: - "8000:8000" # command: /start command: uvicorn config.asgi:application --host 0.0.0.0 # command: uvicorn config.asgi:application --bind 0.0.0.0:8000 --timeout 300 --chdir=/app # /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --timeout 300 --chdir=/app postgres: build: context: . dockerfile: ./compose/production/postgres/Dockerfile image: api_production_postgres container_name: api_local_postgres volumes: - ./api_local_postgres_data:/var/lib/postgresql/data - ./api_local_postgres_data_backups:/backups env_file: - ./.envs/.local/.postgres ports: - "5432" redis: image: redis:6 container_name: api_local_redis celeryworker: <<: *django image: api_local_celeryworker container_name: api_local_celeryworker depends_on: - redis - postgres ports: [] command: /start-celeryworker celerybeat: <<: *django image: api_local_celerybeat container_name: api_local_celerybeat depends_on: - redis - postgres ports: [] command: /start-celerybeat flower: <<: *django image: api_local_flower container_name: api_local_flower ports: - "5555:5555" command: /start-flower Now above, I tried to start using uvicorn and it has no errors. Now here is my asgi file which handles the http … -
Django Session management with Vercel
I have a Django web app currently hosted on Vercel that displays a users top artists and tracks. It utilises the Spotify API to retrieve the access token and request the data. In my app the access token is saved using a class however I've come to a problem where if a user does not enter the site via the main page eg: spotify-app.vercel.app/ and goes straight to spotify-app.vercel.app/top-tracks they see the data of the last person who logged in because the token is saved in the class. I'm also assuming this site would not work when multiple users are on. How would I go about storing the access token for just the current user rather than saving it on the server. I have tried using the sessions library however vercel does not support it. How else can i manage my user sessions? class: class SpotifyAPI(object): access_token = None access_token_expires = datetime.datetime.now() access_token_did_expire = True client_id = None client_secret = None scope = None redirect_uri=None token_url = "https://accounts.spotify.com/api/token" def __init__(self, client_id, client_secret,redirect_uri,scope, *args, **kwargs): super().__init__(*args, **kwargs) self.client_id = client_id self.client_secret = client_secret self.redirect_uri = redirect_uri self.scope = scope def is_token_expired(self): # Check if the access token has expired access_token = … -
Django - How to translate static choices of a form field
I have a form to update the details of the user in a multilingual text. In the dropdown for sex, it does not translate the choice of sex as below: I tried using the gettext_noop in the model.py file for the choices. I see them in the .po file. Still it doesn't work. What am I doing wrong? model.py from django.utils.translation import gettext_noop Account_sex = [('male',gettext_noop('Male')),('female',gettext_noop('Female'))] #List of tuples with choices. First one is what's stored in DB and second what is shown in html. class Account(AbstractBaseUser): first_name = models.CharField(max_length=50) email = models.EmailField(max_length=100, unique=True) sex = models.CharField(max_length=10, blank=True, null=True, choices=Account_sex, default='male') view.py @login_required(login_url='login') def edit_profile(request): if request.user.is_authenticated: current_user = Account.objects.get(id=request.user.id) form = EditProfileForm(request.POST or None, instance=current_user) if form.is_valid(): form.save() messages.success(request,("Your profile has been updated!")) return redirect('dashboard') return render(request, 'accounts/edit_profile.html',context={'form':form}) # else: messages.success(request,('You must be logged in!')) return redirect('login') edit_profile.html <div class="col col-auto form-group"> <label>{% trans "Sex" %}</label> {{ form.sex }} </div> django.po #: .\accounts\models.py:44 msgid "Male" msgstr "Hombre" #: .\accounts\models.py:44 msgid "Female" msgstr "Mujer" -
How to reuse Django Model Form with changed labels?
Inside a Django app I have a Person model that I want to use in a form to capture both student and teacher data. The fields are identical in both forms, but the labels should be different. How can I change the labels before passing the form to the template? The class for the form with default labels for student_form: class ProfileForm(forms.ModelForm): class Meta: model = Person fields = ('first_name', 'last_name', 'email') labels = { 'first_name': label("Student's Name"), 'last_name': label("Student's Surname") } I tried to change the labels attributes as per below, but Django says that ProfileForm has no attribute 'labels'. def add_profile(request): teacher_form = ProfileForm(prefix = 'teacher') teacher_form.labels['first_name'] = label("Teacher's Name") teacher_form.labels['last_name'] = label("Teacher's Surname") return render(request, "school/add_profile.html", { "profileform" : teacher_form }) Is there a way to access the Meta class to change its attributes? -
CSRFTOKEN not defined on incognito
I am working on an application that has the backend on django and the frontend on react. The problem I am facing now is csrftoken. All my forms are submitted on using a normal browser but if I use Incognito mode I cannot submit the request because the csrftoken is not found. The function I use to receive the csrftoken: const getCsrfToken = () => { const value = `; ${document.cookie}`; const parts = value.split(`; csrftoken=`); if (parts.length === 2) return parts.pop().split(';').shift(); }; I know I can use @csrf_exempt on views but I want to keep my app secure. Is there any way to generate that csrftoken even if users use incognito mode? -
my django server is stopping without an error appearing
My Django server is stopping without an error appearing, I am making an application that captures the microphone and transcribes and translates everything that is said using the Google speech-to-text and Google translate APIs and I want to display the output of the API on a web page. I'm having difficulty displaying the return from my api on the django server I tried with ajax and it didn't work I need it to update each sentence simultaneously this is the python code of the application from django.shortcuts import render import speech_recognition as sr from googletrans import Translator import threading import logging logger = logging.getLogger(__name__) translation_running = False def paginaInicial(request): global translation_running if request.method == 'POST': if translation_running: translation_running = False else: translation_running = True translation_thread = threading.Thread(target=perform_translation) translation_thread.start() return render(request, "index.html") def perform_translation(): global translation_running r = sr.Recognizer() mic = sr.Microphone() while translation_running: with mic as source: print("Diga algo...") r.adjust_for_ambient_noise(source) audio = r.listen(source) try: audio_text = r.recognize_google_cloud(audio, credentials_json='', language='pt-BR') print("Texto transcrito:", audio_text) translation_result = translate_text(audio_text) if translation_running: logger.info(f'Texto Original: {audio_text}') logger.info(f'Texto Traduzido em Inglês: {translation_result["translated_text_en"]}') logger.info(f'Texto Traduzido em Espanhol: {translation_result["translated_text_es"]}') except sr.UnknownValueError: print("Não foi possível transcrever o áudio.") except sr.RequestError as e: print("Erro na requisição à API: {0}".format(e)) except Exception … -
Nginx Removing First Sections Of URL
I have Django/Django-CMS website and I use Nginx to proxy pass Gunicorn and load static files. Nginx rules of Django and my template js plugins are getting confused by the including style of functions of theme. Basically theme loads only a functions.js file and all the rest of script files are called from that file. The problem is that, while in the Homepage 'abctasarim.com/static/bootstrap.plugins.js', if I click about-us link, it is becoming 'abctasarim.com/en/about-us/static/bootstrap.functions.js' and I get 404 error code. I tried to find a solution to make it in better way but now I am a little bit lost in the answers. In my nginx.conf, my workaround is as below, which I am sure that can be solved with regex without overwriting the rest of urls. location /static/ { autoindex on; alias /home/ytsejam/public_html/luftchem/luftchem/static_cdn/; expires 365d; access_log off; #add_header Cache-Control "public"; #proxy_ignore_headers "Set-Cookie"; } location /en/about-us/static/ { autoindex on; alias /home/ytsejam/public_html/luftchem/luftchem/static_cdn/; expires 365d; access_log off; #add_header Cache-Control "public"; #proxy_ignore_headers "Set-Cookie"; } How can I write a Regex to loose to parts of url before the static part in sub urls? Thanks -
When calculating integers (without decimal places), is there no difference between integer, float, and decimal?
I know that I should use models.DecimalField when I need an exact result, such as calculating a currency. In my model, I have a "quantity" field that needs to be calculated frequently. However, this "quantity" field is an integer, no decimal calculations are required. In this case, does it make any difference whether I use models.DecimalField, models.FloatField, or models.IntegerField? -
Looking for button to navigate to login page in python using justpy
I'm using justpy to make a small scale management system, its a framework for developing web apps in python without css/html/js. The menu displays itself but none of the buttons work.The following is the code I have so far: import justpy as jp class LoginPage(jp.WebPage): def __init__(self): super().__init__() form_div = jp.Div(classes='w-64 mx-auto mt-10', a=self) self.username_input = jp.Input(placeholder='Username', classes='w-full mb-2 p-2', a=form_div) self.password_input = jp.Input(placeholder='Password', type='password', classes='w-full mb-2 p-2', a=form_div) self.login_button = jp.Button(text='Login', classes='w-full bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded', a=form_div) class MenuPage(jp.BaseWebPage): def __init__(self): super().__init__() self.menu = jp.Div(classes='flex justify-around p-4 bg-blue-500 text-white', a=self) self.login_button = jp.Button(text='LOGIN', classes='p-2 hover:bg-blue-700', a=self.menu, click=self.go_to_login) self.home_button = jp.Button(text='HOME', classes='p-2 hover:bg-blue-700', a=self.menu) self.forums_button = jp.Button(text='FORUMS', classes='p-2 hover:bg-blue-700', a=self.menu) self.help_button = jp.Button(text='HELP', classes='p-2 hover:bg-blue-700', a=self.menu) def go_to_login(self, msg): self.delete() # Remove the menu from the page a = LoginPage() a.show() # Add the login page to the page jp.justpy(MenuPage) I'm trying to create a dashboard with the menu options HOME, LOGIN, FORUMS, HELP. I have implemented the logic of the login button but can't get it to work. I can't get the LOGIN button to work, I tried making two different classes, one for the menu and the other for the login but still no luck. … -
Direct assignment to the reverse side of a many-to-many set is prohibited. Use category.set() instead
a problem on M2M Django assignment this is where i get the error : def update(self, instance, validated_data): instance.title = validated_data.get('title', instance.title) instance.category = validated_data.get('category', instance.category) instance.price = validated_data.get('price', instance.price) instance.description = validated_data.get('description', instance.description) instance.image = validated_data.get('image', instance.image) instance.active = validated_data.get('active', instance.active) instance.deleted = validated_data.get('deleted', instance.deleted) instance.parent_category.set(validated_data.get('parent_category')) instance.save() return instance i tried "add" method too but it gets same error -
How do I obtain Django's user password reset URL within Python (i.e., not within a template)
I am generating a variable text in Python where I need to inject the URL for the user to navigate to after they requested password reset. I.e., I am building a string for content of an email and thus cannot use the standard template language {% url 'password_reset_confirm' uidb64=uid token=token %} What I have so far is: def myFunction(toEmail_): #-- find user to send the email to user = User.objects.get(email=toEmail_) #-- build email text resetUrl = "????" #TODO: WHAT TO PUT IN HERE? emailText = "Hi, please reset your password on this url {}".format(resetUrl) #-- send email with the text ... How do I obtain this reset url in Python? -
Django-admin display decorator sorting by multiple columns
In my database model, I have last and first name. In the django-admin site, I want to display "Lastname, Firstname" and have this column sortable. For this, I'm using the @admin.display decorator in my admin.ModelAdmin class. This decorator takes an ordering parameter which can be a string, referencing a model field name to sort by, for example: @admin.display(description = "Full name", ordering = "last_name") def full_name(self, obj): return f"{obj.last_name}, {obj.first_name}" However, this will only sort by last_name, obviously, and therefore people with the same last name will end up in arbitrary order. I've tried: @admin.display(description = "Full name", ordering = ["last_name", "first_name"]) Or using a list instead of a tuple, but this fails ("'tuple' object has no attribute 'startswith'"). I searched for this and found my exact question unanswered here: https://forum.djangoproject.com/t/how-to-tell-admin-display-decorator-to-order-the-results-by-two-columns/21418 Also in this post: Django-admin order by multiple fields someone suggests that the intuitive list syntax would work with "ordering", but this does not seem to work inside the decorator. -
Unwanted 'email' displayed using Validation Error for Password Reset Form
I'm working on implementing password reset functionality in Django. I wanted to create my own message to the user using the ValidationError class, and I succeeded in doing so. However, unfortunately, an unwanted 'email' is displayed along with this message. forms.py: class ResetPasswordForm(PasswordResetForm): def __init__(self, *args, **kwargs): super(ResetPasswordForm, self).__init__(*args, **kwargs) email = forms.EmailField(max_length=255, label='E-mail Address', required=True, validators=[ValidationError], widget=forms.TextInput(attrs={ 'id': 'register-email', 'label': 'required', 'type': 'text', 'placeholder': 'Your E-mail Address' })) def clean_email(self): email = self.cleaned_data['email'] if not User.objects.filter(email__iexact=email, is_active=True).exists(): raise ValidationError(f"This address e-mail doesn't exists.") return email enter image description here enter image description here HTML: {% extends 'core/base.html' %} {% block title %}{{ title }}{% endblock %} {% block content %} <div id="user-form"> <form class="login-form" method="post" action=""> {% csrf_token %} <div class="form-row"> <div class="input-wrapper"> <label>{{ reset_form.email.label }}</label> {{ reset_form.email }} {{ reset_form.errors }} </div> </div> <div class="submit-row"> <button class="btn" type="submit">Send E-mail</button> </div> </form> </div> {% endblock %} How can I remove it? This knowledge will definitely come in handy in the future. -
Django - filter two M2M fields to one model for specifis condition happening in single object
The problem that I am facing is quite complicated but maybe the answer is simple. So I have a model with two M2M fields to the same model, and I want to filter only these objects which are in 1st field but are not in 2nd. class Model1(models.Model): ... class Model2(models.Model): rel1 = models.ManyToManyField( Model1, related_name="rel1" ) rel2 = models.ManyToManyField( Model1, related_name="rel2" ) and now I want to get objects which for single Model2 objects are only in rel1 not in rel2. For example obj2_1 = Model2(rel1=[obj1, obj2, obj3], rel2=[obj1, obj2]) obj2_2 = Model2(rel1=[obj1, obj3], rel2=[obj3]) Model2.filter(obj_in_rel2_but_not_in_rel1=obj3) -> obj2_1 where object1,2,3 are Model1 instances and obj2_1, obj2_2 are Model2 instances. I would like to get database query, not getting all objects and then making some python filter on that. I am expecting to get some annotation or something similar. It would be even better if I could get the result from perspective of Model1 (Model1.objects.filter(...)) -
Docker compose builds unknown warnings, tables and roles
I need help understanding why my Django App is giving me a long long while hosting the database. The boilerplate is available here: https://github.com/trouchet/tarzan. Please, I am studying and want a remote job, and not be a local attendant in a cafe. As you can see, the app builds and ups as expected, with the following issues, from my perspective: Unknown warning: WARN[0000] The "d" variable is not set. Defaulting to a blank string; Unknown database roles and tables: It starts with the snippet below and goes beyond with several unknown issues. tarzan-memory | 2023-09-13 17:48:28.990 UTC [75] FATAL: password authentication failed for user "newrelic" tarzan-memory | 2023-09-13 17:48:28.990 UTC [75] DETAIL: Role "newrelic" does not exist. tarzan-memory | Connection matched pg_hba.conf line 99: "host all all all md5" tarzan-memory | 2023-09-13 17:48:36.180 UTC [71] ERROR: relation "qrtz_scheduler_state" does not exist at character 15 tarzan-memory | 2023-09-13 17:48:36.180 UTC [71] STATEMENT: SELECT * FROM QRTZ_SCHEDULER_STATE WHERE SCHED_NAME = 'MetabaseScheduler' tarzan-memory | 2023-09-13 17:48:36.180 UTC [72] ERROR: relation "qrtz_triggers" does not exist at character 67 tarzan-memory | 2023-09-13 17:48:36.180 UTC [72] STATEMENT: SELECT TRIGGER_NAME, TRIGGER_GROUP, NEXT_FIRE_TIME, PRIORITY FROM QRTZ_TRIGGERS WHERE SCHED_NAME = 'MetabaseScheduler' AND TRIGGER_STATE = $1 AND NEXT_FIRE_TIME <= $2 …