Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to access User Profile's friends in ManyToMany field
I am building a simple social media app. AND i am trying to build a feature of adding users into post using ManyToManyField. I am trying to access profile friends in Post's model instance "add_user" for tagging user. models.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE,default='',unique=True) full_name = models.CharField(max_length=100,default='') friends = models.ManyToManyField("Profile",blank=True) class Post(models.Model): post_owner = models.ForeignKey(User,default='',null=True,on_delete = models.CASCADE) post_title = models.CharField(max_length=500,default='') add_user = models.ManyToManyField(.........) I have also tried using User.Profile.friends.all BUT it is keep showing. AttributeError: 'ReverseOneToOneDescriptor' object has no attribute 'friends' I am new in django and I have no idea how can i access user's friend in Post's model instance. Any help would be much Appreciated. Thank You in Advance. -
My Django local server is not running on Brave private window
When i try to run my local server on Brave Private Window with Tor connectivity it not running but it's running on Brave Private Window on Brave Private Window with Tor connectivity it's give me this message This site can’t be reachedThe web page at http://127.0.0.1:8000/ might be temporarily down or it may have moved permanently to a new web address. ERR_SOCKS_CONNECTION_FAILED -
Display Foreign key and ManyToMany relation in Django template
model.py class Record(models.Model): items = models.ManyToManyField(Item, blank=True) ... class Item(models.Model): PAYMENT_CLASSIFICATION = ( ('earning','Earning'), ('deduction','Deduction'), ('reimbursement','Reimbursement') ) payment_classification = models.CharField(max_length=20, null=True, choices=PAYMENT_CLASSIFICATION) user_to_input = models.CharField(max_length=20, null=True) ... class EachRowItem(models.Model): item = models.ForeignKey(Item,on_delete=models.SET_NULL, null=True) record = models.ForeignKey(Record,on_delete=models.SET_NULL, null=True) paid_amount = models.DecimalField(max_digits=10, decimal_places =2, null=True, blank=True ) unit = models.DecimalField(max_digits=10, decimal_places =2, null=True, blank=True ) form.py class EachRowItemForm(forms.ModelForm): class Meta: model = EachRowItem exclude = ['record'] view.py def PayRecordUpdate(request, pk): form = EachItemForm(request.POST or None) record = Record.objects.get(pk=pk) if request.is_ajax(): item = request.POST.get('item') paid_amount = request.POST.get('paid_amount') unit = request.POST.get('unit') if form.is_valid(): record = Record.objects.get(pk=pk) instance = form.save(commit=False) instance.record = record record.items.add(item) record.save() instance.save() return JsonResponse({ 'item': instance.item, 'paid_amount': instance.paid_amount, 'unit': instance.unit, }) context ={ 'record': record, 'form':form, } return render(request, '/update_record.html', context) In the template I have a popup Modal to fill in the EachItemForm form. Therefore there is is_ajax(). I can get the valid form. Item paid amount unit Earning Item A1 2.00 2 Item A2 1.00 2 ----- ----------- ---- Deduction Item B1 -2.00 1 Item B2 -1.00 1 ----- ----------- ---- Reimbursement Item C1 2.00 1 Item C2 1.00 1 However, I having problem to render in update_record.html where the items are arranged to classification accordingly. The function has … -
Django UserCreationForm Customization
I am fairly new to django and creating a website that involves account creation. The standard form UserCreationForm is fairly ugly. My main issue with it is that it displays a list of information under the password field. It displays the code in html as follows: <ul> <li>Your password can’t be too similar to your other personal information.</li> <li>Your password must contain at least 8 characters.</li> <li>Your password can’t be a commonly used password..</li> <li>Your password can’t be entirely numeric</li> </ul> Is there any way to avoid displaying this information? Can I change some information in my custom form maybe? My forms.py for this specific form is as follows: class SignUpForm(UserCreationForm): first_name = forms.CharField(max_length=30) last_name = forms.CharField(max_length=30) email = forms.EmailField(max_length=254) class Meta: model = User fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'password2' ) I am unsure how to change this because it isn't an errorlist or anything like that. Any help is greatly appreciated! -
How to add possibility to add many Groups (and date_joined to them) for Person in person creation form in django?
I have a Person and Group models, also I have many-to-many relationship between them with help of third model PersonGroupMembership (I using through= argument). I created forms for Person and Group to allow user to create this objects, and its works good. But now I want to add more functionality to Person creation stage: first of all user need to have possibility to add new Group (or search for already existed), and add date_joined to this Group, and also add as much Groups as user want for this Person. Is there any step-by-step plan how to realize that? How to add this fields to forms? Do I need to turn to PersonGroupMembership model inside Person form? Do I need to add date_joined field to PersonGroupMembership model? -
Django - Using a string variable in a Q filter
I have a very similar query that works for two different types of inputs and will match on the correct column. Both queries are essentially the same except for one word, i.e. the column name. def trade_company_group(company_group): # can filter both name or alias as name will always contain 'Companies' if "COMPANIES" in company_group.upper(): return ( // Same query as below except for "name", below is "alias" Q(buy_book__entity__company_groups__name__iexact=company_group) & Q(sell_book__entity__company_groups__name__iexact=company_group) & ( ~Q(buy_book__entity__type=ENTITY.INTERNAL) | ( Q(buy_book__entity__primary_company_group__name__iexact=company_group) | Q(sell_book__entity__primary_company_group__name__iexact=company_group) ) )) return ( Q(buy_book__entity__company_groups__alias__iexact=company_group) & Q(sell_book__entity__company_groups__alias__iexact=company_group) & ( ~Q(buy_book__entity__type=ENTITY.INTERNAL) | ( Q(buy_book__entity__primary_company_group__alias__iexact=company_group) | Q(sell_book__entity__primary_company_group__alias__iexact=company_group) ) )) I don't want to duplicate code so I was hoping there was a way to substitute the column name in the query depending on my if statement. Is this possible? -
select tag onchange does not execute, function failure: Uncaught ReferenceError: ... is not defined
I'm pretty new to js. I want to execute the function buildChart when the select value changes. But I get the following error all the time. Uncaught ReferenceError: buildChart is not defined Does anybody have an idea how to solve that? Thank you very much in advance! You would be a great help!! My JS function is as follows: function buildChart() { let dropdownValue = getData.getDropdownValue(); if (dropdownValue === "All Generations") { console.log("All Generations") } else { console.log("other") } } My HTML follows here: {% extends "base.html"%} {% load static %} {% block head %} <script rel="script" type="module" src="{% static 'js/productionplan/productionplan.js' %}" defer></script> {% endblock head %} {% block body %} <select id="dropdown-pp" onchange="buildChart();" class="form-select" aria-label="Default select example"> {% endblock %} -
How connect Django administration to Firebase
I am trying to connect Django to Firebase, for moment i'm using Pyrebase and i install it with pip install Pyrebase and with that in my views.py of apps, i'm able to connect to my Firebase database and it work very fine. How should i configure settings.py file to accpet Firebase as default data base? For moment i leave SQlite as default ans i just access to my Firebase in views.py. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } Regards./ -
Subtraction of two columns on two different models by its ID
I have Two Models 1)Invoice 2)Recieved Amount class Party: party_name = models.CharField(max_length=200) class Invoice(models.Model): party = models.ForeignKey(Party,on_delete = models.CASCADE) invoice_amount = models.FloatField(default=0.0) class RecievedAmount(models.Model): party = models.ForeignKey(Party,on_delete = models.CASCADE) recieved_amount = models.FloatField(default=0.0) I want to subtract (invoice_amount) from Invoice Model - (recieved_amount) from RecievedAmount Model based on the PartyId (ForignKey) and return output as [{'party':1,'total_difference':2000},{'party':2,'total_difference':5000}] total_difference = invoice_amount - recieved_amount And also parties can be more than 100. Can you please tell me the query that performs this operation. Thanks -
Web architecture for "sharing" API calls between users
I recently posted a question: How to dynamically create and close infinitely running Celery tasks using Django Channels . But Django channels seems to be a fairly niche area of development so I'd like to open up the question as a question about general architecture patterns. I would ultimately like users of my application to tap into the same data streams dynamically. I am creating a cryptocurrency application where users are accessing the same live price data. It seems ridiculous that every user should have to request an API for the same information. Scenario: Multiple users are receiving BTC/USD data by API request. How can I get this data and share it between users? This problem must have been solved countless times but I'm finding it very difficult to find the correct method for setting up a scalable solution. -
How to customize non_field_errors key using the NON_FIELD_ERRORS_KEY in Django REST framework setting?
In the docs, it was mentioned: Each key in the dictionary will be the field name, and the values will be lists of strings of any error messages corresponding to that field. The non_field_errors key may also be present, and will list any general validation errors. The name of the non_field_errors key may be customized using the NON_FIELD_ERRORS_KEY REST framework setting. How exactly do I do that? Can someone give me a code example of what it would look like in the settings.py file? -
Django: Error implementig ComputedTextField (Cannot force an update in save() with no primary key)
The idea To make the code a bit more understandable, I will first explain what my code (from which the problem probably comes) is supposed to do in the first place: I save reports in my model. I give these reports their own ID or numbering, because this is absolutely necessary.This ID shall be structured as follows: <year><ascending number with leading zeros> Example: 2021001, 2021002, ..., 2022001 The code I have developed the following modellfor this purpose. Since the value is to be calculated automatically, I use the @property decorator. To be able to use the ID (name: einsatznummer) later more easily as a field and simply for my REST Api, I use the computed_property package. class EinsatzPublic(models.Model): STATUS = ( (0,"Entwurf"), (1,"Öffentlich"), (2,"Archiv"), (3,"Papierkorb"), ) author = models.ForeignKey(User, on_delete=models.SET_NULL, null=True, verbose_name="Autor") created = models.DateTimeField(default=timezone.now, editable=False, verbose_name="Erstellt") updated = models.DateTimeField(auto_now= True, editable=False, verbose_name="Aktualisiert") status = models.IntegerField(choices=STATUS, default=0, verbose_name="Status") #(some more fields...) einsatznummer = ComputedTextField(blank=True, compute_from="einsatznummer_calc") alarmzeit = ComputedTextField(blank=True,compute_from="alarmzeit_calc") alarmdatum = ComputedTextField(blank=True, compute_from="alarmdatum_calc") @property def alarmdatum_calc(self): date = self.einsatz_start.date() return date.strftime("%d.%m.%y") @property def alarmzeit_calc(self): date = self.einsatz_start.date() return date.strftime("%H:%M") @property def einsatznummer_calc(self): year_einsatz = self.einsatz_start.strftime('%Y') last_number = EinsatzPublic.objects.filter(einsatznummer__isnull=False, einsatz_start__year=year_einsatz).values_list('einsatznummer', flat=True) if last_number: if last_number[:-1] != year_einsatz: last_number = '0' einsatznummer_gen = … -
Javascript not loading in Django html
I'm trying to include JavaScript in my html design in Django. I'm getting 304 response but the javascript is not showing on the page. GET /static/js/app.js HTTP/1.1" 304 0 I'm loading it in the head tag in html like this <script src="{% static 'js/app.js' %}" type="text/javascript" ></script> Can someone help me figure out what I'm doing wrong? -
Multiple user sign up with django-allauth. Two signup forms not render
I am trying to implement two user types with allauth. I have read so many tutorials, documentations, and so on. Still can't render my custom two forms for registrations. When i add in settings ACCOUNT_FORMS = { 'signup': ...} which form to be used is ok. But for both is not rendered. Models.py from django.contrib.auth.models import AbstractUser from django.db import models class User(AbstractUser): is_worker = models.BooleanField(default=False) is_company = models.BooleanField(default=False) class Worker(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) image = models.ImageField(default="default.jpg", upload_to='profile_pics') first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) phone = models.IntegerField() def __str__(self): return f'{self.user.username}' class Company(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) image = models.ImageField(default="default.jpg", upload_to='profile_pics') adrress = models.CharField(max_length=300) phone = models.IntegerField() def __str__(self): return f'{self.user.username}' forms.py from . models import User, Worker, Company from django import forms from allauth.account.forms import SignupForm class WorkerSignupForm(SignupForm): first_name = forms.CharField(label='First Name', max_length=50, required=True, strip=True) last_name = forms.CharField(label='Last Name', max_length=50, required=True, strip=True) phone = forms.CharField(label='Mobile phone', max_length=15, required=True, strip=True) def save(self, request): user = super(WorkerSignupForm, self).save(request) user.first_name = self.cleaned_data.get('first_name') user.last_name = self.cleaned_data.get('last_name') user.phone = self.cleaned_data.get('phone') user.is_worker = True user.save() return user class CompanySignupForm(SignupForm): company_name = forms.CharField(label='Comapny name', max_length=100) adrress = forms.CharField(label='Adrress', max_length=250) phone = forms.CharField(label='Mobile phone', max_length=15) def save(self, request): user = super(CompanySignupForm, self).save(request) user.company_name = … -
Is there a way to store the metadata in sqlite?
hi am doing a Django app and I got some metadata. I want to store them in SQLite but I have no idea if it is possible? because some tags are the same like "contributor" and some have "dc" before the tag name and some don't: the data looks like: <?xml version="1.0" encoding="UTF-8"?> <dataset xmlns="urn:pangaea.de:dataportals" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:pangaea.de:dataportals http://ws.pangaea.de/schemas/pansimple/pansimple.xsd"> <dc:title>Sorex araneus Linnaeus, 1758, a preserved specimen record of the Mammals (recent) dataset [ID: ZMB_Mam_050329 ]</dc:title> <dc:description>The Animal Sound Archive at the Museum fuer Naturkunde Berlin (German: Tierstimmenarchiv) is one of the oldest and largest worldwide. Founded in 1951 by Professor Guenter Tembrock the collection consists now of around 130 000 records of animal voices.</dc:description> <dc:contributor>Christiane Funk</dc:contributor> <dc:contributor>MfN</dc:contributor> <dc:contributor>Museum für Naturkunde Berlin – Leibniz Institute for Research on Evolution and Biodiversity, Berlin</dc:contributor> <dc:contributor>Zenker, R</dc:contributor> <dc:contributor>Kulicke</dc:contributor> <dc:contributor>Zenker, R</dc:contributor> <dc:contributor>Kulicke, R</dc:contributor> <dc:contributor>Kulicke, R</dc:contributor> <dc:contributor>Kulicke, R</dc:contributor> <dc:contributor>Kulicke, R</dc:contributor> <dc:contributor>Kulicke, R</dc:contributor> <dc:contributor>Kulicke, R</dc:contributor> <dc:contributor>Kulicke, R</dc:contributor> <dc:contributor>Kulicke, R</dc:contributor> <dc:contributor>Kulicke, R</dc:contributor> <dc:publisher>Data Center MfN</dc:publisher> <dataCenter>Data Center MfN</dataCenter> <dc:type>ABCD_Unit</dc:type> <dc:type>preserved specimen</dc:type> <dc:format>text/html</dc:format> <dc:identifier>ZMB_Mam_050329</dc:identifier> <dc:source>MfN Custodians (2017). MfN Zoological Collections - Mammals (recent). [Dataset]. Data Publisher: Museum für Naturkunde Berlin (MfN) - Leibniz Institute for Research on Evolution and Biodiversity.</dc:source> <linkage type="metadata">http://biocase.naturkundemuseum-berlin.de/current?dsa=mfn_Mammalia&amp;detail=unit&amp;schema=http://www.tdwg.org/schemas/abcd/2.06&amp;cat=ZMB_Mam_050329</linkage> <dc:coverage xsi:type="CoverageType"> <northBoundLatitude>52.4256800000</northBoundLatitude> <westBoundLongitude>14.2540400000</westBoundLongitude> <southBoundLatitude>52.4256800000</southBoundLatitude> <eastBoundLongitude>14.2540400000</eastBoundLongitude> <startDate>1961-08-03T00:00:00</startDate> … -
Django connect to a remote database
How do I query a remote database particularly an Oracle (or any database really) database, do I have to create a model for the database? Also why would I need to create a model for the tables in that database if the tables already exist? -
html input value turns to placeholder
I' m working with Django project with Python. I have a example input area like this; <form method="GET"> <input type="text" name="product_code" placeholder="Please enter product code"> <button type="submit" class="btn btn-success">Search</button> </form> When I send the form with "Search" button, I want to see inputted value but I see placeholder again "Please enter product code". I changed the placeholder with {{variable}} but it doesn't work. -
Uncaught TypeError: Cannot read property 'send' of null
document.getElementById('id_chat_message_input').focus(); document.getElementById('id_chat_message_input').onkeyup = function(e) { if (e.keyCode === 13 && e.shiftKey) { // enter + return // Handled automatically by textarea } else if(e.keyCode === 13 && !e.shiftKey){ // enter + !return document.getElementById('id_chat_message_submit').click(); } console.log("received message"); }; document.getElementById('id_chat_message_submit').onclick = function(e) { const messageInputDom = document.getElementById('id_chat_message_input'); const message = document.getElementById('id_chat_message_input').value; console.log(message); chatSocket.send(JSON.stringify({ "command": "send", "message": message, "room": roomId })); messageInputDom.value = ''; }; <div class="card-body p-1"> <div class="d-flex flex-column" id="id_chat_log_container"> <div class="d-flex flex-row justify-content-center" id="id_chatroom_loading_spinner_container"> <div class="spinner-border text-primary" id="id_chatroom_loading_spinner" role="status" style="display: none; "> <span class="sr-only">Loading...</span> </div> </div> <div class="d-flex chat-log" id="id_chat_log"> </div> <span class="{% if not debug %}d-none{% endif %} page-number" id="id_page_number">1</span> <div class="d-flex flex-row chat-message-input-container"> <textarea class="flex-grow-1 chat-message-input" id="id_chat_message_input"></textarea> <button class="btn btn-primary chat-message-submit-button"> <span id="id_chat_message_submit" class="material-icons">send </span> </button> </div> </div> </div> Error: Uncaught TypeError: Cannot read property 'send' of null at HTMLSpanElement.document.getElementById.onclick Iam doing chatapplication using django. When i typed a message and click send iam getting this error, it is not sending. very thankful to you :) -
Is There A Way That Client Can Add Language Specific Inputs?
I want to take language inputs from my clients. For example : <input type="text" name="title" class="form-control" required="" id="en"> # For English Input <input type="text" name="title" class="form-control" required="" id="fr"> # For French Input <input type="text" name="title" class="form-control" required="" id="es"> # For Spanish Input I want to store them as dictionary as the { 'lang' : 'title', 'lang2' : 'title2', 'lang3' : 'title3 } pairs . I use Django as my backend. Is there a way that I can do that with Django forms? -
Only approved users should post blogs in django
I have build a blog based web-application using Django , Where users can login and wrote articles and those articles are being posted after admin approval. But right now all users can post articles. I want only those users to post the articles which are approved . I am using default Django user model . From users I only create a profile model. My users models.py is: from django.db import models from django.contrib.auth.models import User from PIL import Image # Create your models here. class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) image = models.ImageField(default='default.jpg', upload_to='profile_pic') posting_post = models.BooleanField(default=False) def __str__(self): return f'{self.user.username} Profile' def save(self , *args, **kwargs): super().save() My postcreate view is: class PostCreateView(TagMixin, LoginRequiredMixin, CreateView): model = Post fields = ['title', 'content', 'image',] def form_valid(self, form): form.instance.author = self.request.user form.save() return HttpResponseRedirect('admin-approval') and my html for create post is: {% if user.is_authenticated %} <li class="nav-item"> <a class="nav-link" href="{% url 'post-create'%}">New Post</a> </li> <li class="nav-item"> -
django howto include urls from app into an existant namespace
My project has a namespace 'dashboard' and I'd like to include an app (django-calendar) into it, so my urls would be like /dashboard/calendar-list. So in dashboard urls.py I added: (...) path("avoirs/", include(avoirs_urls)), path("vouchers/", include(vouchers_urls)), path("logs/", include(log_urls)), path('schedule', include('schedule.urls', namespace='schedule')), (...) So I can reverse my urls using for example: reverse("dashboard:schedule:calendar_list") It's where I came accross a pitfall: All the app code uses urls like calendar_list and not schedule:calendar_list. Same for templates using code like {% url 'calendar_list' %}. It doesn't seem reasonable to refactor all the calendar app to fit my project. Is there a way to include it in the existing namespace? What's the guideline here? Thanks to share knowledge... -
Adding Data to ManytoMany Field Django
I am creating a dynamic form using javascript. Here are the models which I am using to store the data. one_label_fields = ['text','color','date','number','email','password'] class InputFieldNames(models.Model): name= models.CharField(max_length=40) #one field inputs :text,color,date,email,number,password def __str__(self): return self.name class OneLabelInputField(models.Model): label = models.CharField(max_length =40) value =models.CharField(max_length=40) def __str__(self): return "Label: "+self.label +"| Value: "+self.value class CheckBoxLabel(models.Model): label =models.CharField(max_length=40) def __str__(self): return self.label class CheckBoxField(models.Model): group_name = models.CharField(max_length=40) labels = models.ManyToManyField(CheckBoxLabel) def __str__(self): return self.group_name class DynamicForm(models.Model): single_label_fields =models.ManyToManyField() checkboxes = models.ManyToManyField(CheckBoxField) Here is my View function def form_creation(request): if request.method == 'POST': input_types = InputFieldNames.objects.all() form = DynamicForm.objects.create() print("form cretaetd ->",form) for x in input_types: #print(x.name) input_fields = request.POST.getlist(x.name) print("INPUT FIELDS:",input_fields) label_name = 'hidden_'+x.name #print(label_name) input_field_labels = request.POST.getlist(label_name) print("LABELS OF THE RESPECTIVD FIELDS",input_field_labels) length = len(input_fields) if length: for i in range(length): field = OneLabelInputField.objects.create(label = input_field_labels[i], value=input_fields[i]) form.single_label_fields.add(OneLabelInputField.objects.get(id= field.id)) print(">>>",form) # if input_fields: # print(input_fields) # print(input_field_labels) inputs = InputFieldNames.objects.all() context={} context['inputs'] = inputs #context['one_label_fields'] = json.dumps(one_label_fields) return render(request,"dynamic_form.html",context) I have declared many to many field in the Dynamic form model,because I want to store multiple objects of SingleLabelInputField and connect its relation with Dynamic Form. Whenever I create a Dynamic form ,and submit the data, the data is saved without any … -
Uanble to connect to remote mysql phpmyadmin
I'm trying to connect to remote phpmyadmin through my Django application. 'client4': { 'ENGINE': 'django.db.backends.mysql', 'NAME': config('DATABASE_NAME_5'), 'USER': 'username', 'PASSWORD': config('DATABASE_PASSWORD_PHPMYADMIN'), 'HOST': 'xxx.xx.xxx.xxx', 'PORT': '3306', }, When I run makemigrations, django.db.utils.OperationalError: (1045, "Access denied for user 'username'@'yyy.yy.yyy.yyy' (using password: YES)") This error pops. But the IP address shown here is different and unknown to me. I tried connecting to 2 different IP addresses but the same IP address keeps popping in the error. I tried to connect to a remote server using the terminal command, mysql -u root -h xxx.xxx.xx.xxx -p Led to the same error, ERROR 1045 (28000): Access denied for user 'root'@'yyy.yy.yyy.yyy' (using password: YES) with the same IP popping up again. I am unable to figure out what where this IP is coming from. I also checked my local IPs using ifconfig But this IP was not seen anywhere. Please help me out here. Thanks. -
Heroku application error logs, cannot run heroku open
I just made my first application. when I run Heroku open I get an error "Application error An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command heroku logs --tail" what could possibly be the problem?Can a problem with DJANGO_SECRET_KEY cause such problem ? this is my logs 2021-06-11T05:06:11.906892+00:00 app[api]: Initial release by user a 2021-06-11T05:06:11.906892+00:00 app[api]: Release v1 created by user a 2021-06-11T05:06:12.046032+00:00 app[api]: Enable Logplex by user a 2021-06-11T05:06:12.046032+00:00 app[api]: Release v2 created by user a 2021-06-11T06:24:58.000000+00:00 app[api]: Build started by user 2021-06-11T06:25:45.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/67a0bf8e-56f4-41bd-b9de-b02c9ca20f13/activity/builds/b4469f36-8883-468b-95a2-aadaa03ff662 2021-06-11T06:36:08.000000+00:00 app[api]: Build started by user a 2021-06-11T06:36:39.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/67a0bf8e-56f4-41bd-b9de-b02c9ca20f13/activity/builds/254007fa-69b7-45d7-9490-5bd0643ec3cf 2021-06-11T06:37:40.559478+00:00 app[api]: Set DISABLE_COLLECTSTATIC config vars by user a 2021-06-11T06:37:40.559478+00:00 app[api]: Release v3 created by user a 2021-06-11T06:38:00.000000+00:00 app[api]: Build started by user a 2021-06-11T06:38:41.947391+00:00 app[api]: Running release v4 commands by user a 2021-06-11T06:38:41.947391+00:00 app[api]: Attach DATABASE (@ref:postgresql-fitted-13790) by user a 2021-06-11T06:38:41.960986+00:00 app[api]: @ref:postgresql-fitted-13790 completed provisioning, setting DATABASE_URL. by user a 2021-06-11T06:38:41.960986+00:00 app[api]: Release v5 created by user a 2021-06-11T06:38:42.248836+00:00 app[api]: Release v6 created … -
in django Mongodb Like (in mysql keyword) same in mongo db not working
Questions.objects.find({ps_tags: "/"+request.POST['txtTag']+"/"}).values() this is the code where I am using to search related words from the database but I am getting the following error. ERROR AttributeError: 'Manager' object has no attribute 'find' I want to implement code search (in MySQL if we want to search then we will use LIKE key word for matching rows from multiple rows) same like in Django MongoDB I want to implement but I am getting the above error, any solution for this?