Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
I cant able to send email using django even I gave all permission from google side
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIT_PORT = 587 EMAIL_HOST_USER = 'your@gmail.com' EMAIL_HOST_PASSWORD = 'password' EMAIL_USE_TLS = True EMAIL_USE_SSL= False send_mail(msg,"Thank-You for using our Website ,Mail us if you have any Problem in Our Website.Thank-You Once again" , settings.EMAIL_HOST_USER,[emailto,],fail_silently=False,) I cant send mail it showing timeout error even i have tried EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' I cant send the mail instead of that i am getting printed in console box [11/Sep/2020 23:07:49] "POST / HTTP/1.1" 200 3502 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Hello User From: tamilan0tamill@gmail.com To: bahubali@gmail.com Date: Fri, 11 Sep 2020 17:39:50 -0000 Message-ID: 159984599099.7876.4877994479538514933@UNIVERSE Thank-You for using our Website ,Mail us if you have any Problem in Our Website.Thank-You Once again -
How to get Required result in framework?
I have the following models and want to display some required results in web API. class Poll(models.Model): question = models.CharField(max_length=100) created_by = models.ForeignKey(User, on_delete=models.CASCADE) pub_date = models.DateTimeField(auto_now=True) class Choice(models.Model): poll = models.ForeignKey(Poll, related_name='choices', on_delete=models.CASCADE) choice_text = models.CharField(max_length=100) class Vote(models.Model): choice = models.ForeignKey(Choice, related_name='votes', on_delete=models.CASCADE) poll = models.ForeignKey(Poll, on_delete=models.CASCADE) voted_by = models.ForeignKey(User, on_delete=models.CASCADE) And i set the in te way like below: class VoteSerializer(serializers.ModelSerializer): voted_by = serializers.StringRelatedField(many=False) class Meta: model = Vote fields = '__all__' class ChoiceSerializer(serializers.ModelSerializer): votes = VoteSerializer(many=True, required=False) class Meta: model = Choice fields = '__all__' class PollSerializer(serializers.ModelSerializer): choices = ChoiceSerializer(many=True, read_only=True, required=False) created_by = serializers.StringRelatedField(many=False) class Meta: model = Poll fields = '__all__' class UserSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('username', 'email', 'password') extra_kwargs = {'password': {'write_only': True}} def create(self, validated_data): user = User( email=validated_data['email'], username=validated_data['username'] ) user.set_password(validated_data['password']) user.save() Token.objects.create(user=user) return user I want an result where only those votes are display in choices where vote_by='the choicse id'. **But the result include all the votes ** { "id": 1, "votes": [ { "id": 1, "voted_by": 1, "choice": 1, "poll": 1 }, { "id": 2, "voted_by": 2, "choice": 1, "poll": 1 } ], "choice_text": "it provide web API and authentication permissions for security.", "poll": 1 } -
Using local timezone in django admin template
After crying under my desk for a while over this problem I got the courage to come on SO and ask this question. I have a django model: entry_time = models.DateTimeField(auto_now_add=True) On my admin change_form.html and change_list.html I would like to display that object in local time. I've read the django docs on this, my biggest problem I think is that I'm modifying the template and am not directly calling the object. Settings.py: TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True I have tried changing the TIME_ZONE to US/Arizona which didn't work. I tried solutions i found at Setting Django admin display times to local time? such as custom templates using {% extends "admin/change_list.html" %} {% load tz %} {% block content %} {% timezone "US/Eastern" %} {{ block.super }} {% endtimezone %} {% endblock %} This did nothing, my time is still UTC on change_form. I tried installing a middleware package (awesome-django-timezones) that uses js to find local timezone and change it using middleware. This did nothing as well. I also tried going into options.py and adding activate() into the view that calls change_form.html-- no success. Am I missing something? How can I extend the … -
GET /static/vendor/select2/dist/css/select2.css HTTP/1.1" 404 1832
I want to add autocomplete_light to a django field as explained here. I will explain you shortly the steps and error: in setting.py: INSTALLED_APPS = [ 'dal', 'dal_select2', 'cities_light'] in views.py: class CountryAutocomplete(autocomplete.Select2QuerySetView): def get_queryset(self): if not self.request.user.is_authenticated(): return Country.objects.none() qs = Country.objects.all() if self.q: qs = qs.filter(name__icontains=self.q) return qs in urls.py: urlpatterns = [ path('country-autocomplete/', CountryAutocomplete.as_view(), name='country-autocomplete'),.. ] in models.py: class Person(models.Model): birth_country = = models.ForeignKey(Country, on_delete=models.CASCADE) in forms.py: class PersonForm(forms.ModelForm): birth_country = forms.ModelChoiceField( queryset=Country.objects.all(), widget=autocomplete.ModelSelect2(url='country-autocomplete') ) class Meta: model = Person fields = "__all__" and in html: {% extends "myapp/base.html" %} {% load static %} {% block content %} <form id="anything" method="POST" enctype="multipart/form-data"> <div class="searchable"> {{form.birth_country}} </div> </form <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/js/select2.min.js"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.10/css/select2.min.css" rel="stylesheet"/> {{ form.media }} {% endblock content %} This is the Error: The birth_country field in Person form is not populated to be autocomplete. Also in terminal I get this error (not quit sure if this is the reason): GET /static/vendor/select2/dist/css/select2.css HTTP/1.1" 404 1832 and this should be the path to this file, however it looks empty: and I would like to know where can I find it, or why it is not imported! -
Is it possible to get a python program that uses tkinter to run in a web page using flask?
I have a python program that I would like to use in a web server. For that I need to convert it to web environment. I read that you can do it with flask. the challenge is that the program is a GUI made with tkinter. If I run the following program through the cmd: flask run, it runs in the local host, (http://127.0.0.1:5000/). If I copy the address and put it in a web browser, I get the error Internal Server Error in the web window, but a new window open in my computer with the checkbutton and the label. The program works; What I need is to put that window with the checkbutton and the label inside the web window, so I can eventually put it on a server. (I have hundreds of widgets for what i was forced to use the place.method and I don't want to code everything from scratch in another language). Is there anyway to do it? from flask import Flask from tkinter import * app = Flask(__name__) @app.route("/") def hello(): root = Tk() out = Label(root, text="0", bg="red") def out_result(): out.configure(text="button pressed") button1 = Checkbutton(root, command=out_result) button1.place(x=20, y=20) out.place(x=50, y=20) root.mainloop() -
How to add inbox notification system and delete message from one user django channels
I am trying to build a messenger like application using Django, Django-rest-framework, and Django-channels. Right now I can only send messages from one user to another user. But I want to add features like, new messages will be on top in the inbox along with the username and one user can delete messages from his side, just like messenger, whats app, etc. When someone sends a message his message will be on top and will show a notification. I am unable to find out perfect model design and perfect system for doing it. Model.py from django.contrib.auth import get_user_model from django.db import models User = get_user_model() class Message(models.Model): sender = models.ForeignKey(User, on_delete=models.CASCADE, related_name='sender_messages') receiver = models.ForeignKey(User, on_delete=models.CASCADE, related_name='receiver_messages') text = models.TextField() date_created = models.DateTimeField(auto_now_add=True) def __str__(self): return '{} to {}'.format(self.sender.name, self.receiver.name) consumer import json from asgiref.sync import async_to_sync from django.contrib.auth import get_user_model from channels.generic.websocket import WebsocketConsumer from .models import Message User = get_user_model() class ChatConsumer(WebsocketConsumer): def connect(self): """ Join channel group by chatname. """ self.group_name = 'chat_{0}'.format(self.scope['url_route']['kwargs']['chatname']) async_to_sync(self.channel_layer.group_add)( self.group_name, self.channel_name, ) self.accept() def disconnect(self, close_code): """ Leave channel by group name. """ async_to_sync(self.channel_layer.group_discard)( self.group_name, self.channel_name ) def receive(self, text_data): """ Receive message from websocket and send message to channel group. """ … -
i am trying to fetch notes materials that are related to one specific course
enter code here**` <div class="site-section"> <div class="container"> <div class="row"> {% for course_item in courses%} <div class="col-lg-4 col-md-6 mb-4"> <div class="course-1-item"> <figure class="thumnail"> <div class="category"><h3>{{course_item.title}}</h3></div> </figure> <div class="course-1-content pb-4"> <h2>How To Create Mobile Apps Using Ionic</h2> <div class="rating text-center mb-3"> <span class="icon-star2 text-warning"></span> <span class="icon-star2 text-warning"></span> <span class="icon-star2 text-warning"></span> <span class="icon-star2 text-warning"></span> <span class="icon-star2 text-warning"></span> </div> <p class="desc mb-4">{{course_item.description}}</p> <p><a href="{% url 'notes' course_item.id %}" class="btn btn-primary rounded-0 px-4">Enroll In This Course</a></p> </div> </div> </div> {% endfor %} </div> </div> </div> {% endblock %} def Courses(request): current_user = request.user courses = Course.objects.filter(students__user__id=current_user.id) return render(request, 'e-learning/courses.html', {'courses':courses}) def Materials(request): notes = NotesMaterial.objects.filter(course_id) return render(request, 'e-learning/materials.html',{'notes':notes}) urlpatterns = [ url(r"^courses/$", views.Courses, name="courses"), url(r'^notes/$', views.Materials, name="notes"), ] class NotesMaterial(models.Model): note_title = models.CharField(max_length=200, null=False) note_description = models.CharField(max_length=200, null=False) course = models.OneToOneField(Course, on_delete=models.CASCADE, null=True) NoReverseMatch at /e-learning/courses/ Reverse for 'notes' with arguments '(1,)' not found. 1 pattern(s) tried: ['e-`learning/notes/$'] Blockquote i am trying to fetch notes materials that are related to one specific course.. ive tried filtering using the course_id which i passed in the template as the course_item.id. Notes material model is related on a one to one relationship with the course. `** -
How can i keep selenium connections open in django?
so i'm using Django and i have a web api liket this https://example.net/open-get-string i want to open a connection to a url and get a string , then return that string as the web api response. i want to keep open the connection i've opened until i get that string back in this url https://example.net/send-string and i want to pass the string given in this url to the selenium connection i've made before. I don't have any idea about how can i keep connection open until i get the string back. -
Django - Incorrect type. Expected pk value, received str
I have 2 django models: Post and Comment: class Post(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) title = models.CharField(max_length=120) class Comment(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) content = models.CharField(max_length=120) post = models.ForeignKey(Post,on_delete=models.CASCADE) class PostCommentCreateView(APIView): queryset = Comment.objects.all() serializer_class = PostCommentCreateSerializer def get(self, request, format=None, *args, **kwargs): serializer = PostCommentCreateSerializer() return Response({'serializer':serializer.data}) def post(self, request, *args, **kwargs): post = int(self.kwargs['postid']) print(post) #1 comment_data = request.data data_ = [elem for elem in comment_data.values()] content = data_[0] csrf = data_[1] user = request.user.username new_comment = {'user':user,'content':content,'post':post, 'csrfmiddlewaretoken':csrf} commentdict = QueryDict('', mutable=True) commentdict.update(new_comment) serializer = PostCommentCreateSerializer(data=new_comment) if not serializer.is_valid(): return Response({'data':serializer.errors}) serializer.save() userimage = request.user.profile.image.url resp_data = { 'user':user, 'userimage':userimage, 'content':content } return Response({'data':resp_data}) class TrackCommentCreateSerializer(serializers.ModelSerializer): class Meta: model = Comment fields = ['user','content','post'] When I try to post a comment with the post id, I get an error that a pk value is expected and not a string. Thank you for any suggestions -
Is there a way to run 1000 multiprocess, all running together
Due to a problem, I need to run 1000+ multiprocess, all running at the same time. Is that possible in Django and Python? -
Wagtail ReadOnlyPreviewPanel?
I would like to be able to dynamically update a readonly field. I'm using the ReadOnlyPanel as described in the following post: Wagtail: how to set calculated fields (@property) title in admin So when a user changes a certain value, for example in an InlinePanel, the read only field should update and the user can preview what the read only field will look like before publishing. Is this possible currently in Wagtail? -
How create appointment system in Django
Please I am currently working on Hospital Management System project but a bit stack for a while now. In my App, I want to set the patient to the appointment Model. Patients' details are shown in a table and what I want to do is when a row is clicked the patient is assign to the Appointment form and once the date and time are set, the data is saved in the appointment module. Thanks -
Django DateInput placholder
I am new to django and I have problem with showing my DateInput form. I want to use placholder in my DateInput, but its not working. Let me show you my code. forms.py class MyForm(forms.Form): my_date_field = forms.DateField(widget=forms.widgets.DateInput(attrs={"type":"date", 'placeholder': 'Select a date', 'required': 'required'}), label='Date') form.html <html lang="en"><head> <meta charset="UTF-8"> <title>Prva</title></head><body><form method="post"> {% csrf_token %} {{ form }} <button type="submit">Submit</button></form></body></html> I get this result And one more question, is there any way to make only year select DateInput. -
Django ms sql server 2014 Db configuration
Database connection between django and MicroSoft SQL server DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'NAME': 'Hospital', 'USER': 'root', 'PASSWORD':'upload', 'HOST':'192.168.1.4', 'PORT': '1433', 'OPTIONS': { 'driver': 'ODBC Driver 17 for SQL Server', } } } I tried some methods. but it repeatedly showing below error. File "C:\Users\surendar\Desktop\pybatch\venv\lib\site-packages\django\db\utils.py", line 121, in load_backend raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: 'sql_server.pyodbc' isn't an available database backend. Try using 'django.db.backends.XXX', where XXX is one of: 'mysql', 'oracle', 'postgresql', 'sqlite3' -
Failed to run django app using docker containers
I'm trying to run a Django app on localhost:8000. I have a docker-compose.yml file that creates 3 containers (badgr-server_api, badgr-server_memcached and badgr-server_db_). When I run docker-compose up it says starting 2 of the containers and creating the 3rd (badgr-server_api) and I only see memchased and db running, see screenshot. I have tried deleting the badgr-server_api and running it again, I tried removing the image. I also ran docker-compose build again but I just can't get it to run. I hope someone can help please. [docker-compose up screenshot][1] After running docker, I also ran this command: docker-compose exec api python /badgr_server/manage.py migrate and get this result: File "/badgr_server/manage.py", line 13, in <module> File "/usr/local/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 212, in get_connection_params isolation_level = options.pop('isolation_level', 'read committed') TypeError: pop() takes no arguments (2 given)``` This is my docker-compose.yml: ```# A dockerized badgr-server stack for development version: '3.3' services: # this container mirrors in the app code and runs the django dev server api: build: context: . dockerfile: .docker/Dockerfile.dev.api depends_on: - "db" - "memcached" command: /badgr_server/manage.py runserver 0.0.0.0:8000 volumes: - ./apps:/badgr_server/apps - ./manage.py:/badgr_server/manage.py - ./.docker/etc/settings_local.dev.py:/badgr_server/apps/mainsite/settings_local.py networks: - badgr ports: - "8000:8000" # this container runs memcached memcached: image: 'bitnami/memcached:latest' expose: - "11211" networks: - badgr # … -
Django - TemplateSyntaxError - Could not parse the remainder: ' + 1' from 'forloop.counter + 1'
I'm building a site which there's comments and stuff. And I want to users to see a icon for their comments and that should toggle two more buttons which are edit and delete. In order to do this I have to give different ids for each div that I want to be toggled. So here is my try: {% for comment in object.comment_set.all %} <!--Rest of the code--> {% if comment.author == request.user %} <div> <button class="btn btn-outline-secondary" data-toggle="collapse" data-target=".multi-collapse" aria-expanded="false" aria-controls="multiCollapseComment{{ forloop.counter }} multiCollapseComment{{ forloop.counter + 1 }}"> <i class="fas fa-ellipsis-v"></i> </button> <div class="row"> <div class="col"> <div class="collapse multi-collapse" id="multiCollapseComment{{ forloop.counter }}"> <a class="btn btn-secondary btn-sm mt-1 mb-1" href="{%url 'posts:comment_edit' object.pk comment.pk%}">Edit</a> </div> </div> <div class="col"> <div class="collapse multi-collapse" id="multiCollapseComment{{ forloop.counter + 1 }}"> <a class=" btn btn-outline-danger btn-sm mt-1 mb-1" href="{% url 'posts:comment_delete' object.pk comment.pk %}">Delete</a> </div> </div> </div> </div> {% endif %} <!--Code here too--> {% endfor %} But it gives me a TemplateSyntaxError that could not parse the remainder '+1'. But I just want to access to the counter + 1 value from template. I have thought about adding new template tag but I do not think that is related. I can't just pass some additional … -
Crispyform Django : is there any way to get multi field with CrispyForm?
Is possible to get multiple image upload field with CrispyForm? If I want to upload multiple Image? class CreateStoryForm(forms.ModelForm): def __init__(self,*args,**kwargs): super(CreateStoryForm, self).__init__(*args,**kwargs) self.helper = FormHelper() self.helper.form_method = 'post' self.helper.field_class = 'mt-10' self.helper.layout = Layout( Field("title",css_class="single-input"), Field("image",css_class="single-input"), ) self.helper.add_input(Submit('submit','Add a story',css_class="single-input textinput textInput form-control")) class Meta: model = Story widgets = { 'title':forms.TextInput(attrs={'class':'','style':'list-style: none;','placeholder':'Lunch time'}), } fields = ('title','image',) -
Parsing/Converting Excel formatted Data to HTML Tags or Quill format in Python
I have a large excel file with a column of descriptions. In each row there is some text with in the standard Excel Format with bullets and carriage returns, like this: My first Line Second Line sub bullet 1 sub bullet 2 Sentence about something another bullet Another bullet Another sentence I need to convert these ~excel~ formatted rows into HTML tags with <p>, <ul>, <li>... It would be even better to convert them directly into the Quill Json format, but I'm will to settle for the HTML tags for the interim as that will get be half way there to the Quill format. How can I do this? -
How to use widgets in django-filter fields?
Wanted to set widgets "class":"form-control" to django-filter fields. filters.py from django_filters import FilterSet,DateFilter,CharFilter,DateFromToRangeFilter from django_filters.widgets import RangeWidget,CSVWidget,DateRangeWidget from django import forms from .models import Blog class BlogFilter(FilterSet): start_date = DateFilter(field_name="created_at",lookup_expr='gte',label='From date', widget=DateFromToRangeFilter(attrs={ 'placeholder':'YYYY/MM/DD', 'class':'form-control' }) ) end_date = DateFilter(field_name="created_at",lookup_expr='lte',label='To date') blog_name = CharFilter(field_name="blog_name",lookup_expr='icontains',label='Blog Name', widget=TextWidgets(attrs={ 'class':'form-control' }) ) class Meta: model = Blog fields = ('category','status','user') tried to write widget in meta class also but didn't work. Which widget to be used for CharFilter? (like we use forms.TextInput(attrs={'class':'form-control'} in django forms) Which widget to be used for DateFilter? -
Django channels integration into django project problem
I'm following this Django channels tutorial - https://channels.readthedocs.io/en/latest/ I got to the part where I'm trying to "Enable a channel layer" - https://channels.readthedocs.io/en/latest/tutorial/part_2.html#enable-a-channel-layer Then, I got that problem: [Errno 61] Connect call failed ('127.0.0.1', 6379) - enter image description here and chrome inspect shows: enter image description here -
How can I use atomic and roll back in django?
i want to save dict that are in list into model Django,but it is possible to happen error.if there is any error i want to roll back return all of dict that are saved in database. def test(): with transaction.atomic(): for i in list_pr: try: product_obj = Product.objects.get(pk=i) product_obj.avail=True product_obj.save() except Exception as e: exceptions.append({'id': i,'error': str(e)}) -
Django model virtual field
Just faced an issue with defining the virtual field for the django model. IE, the column which I will set by an initializer, but without saving into DB. I need this to support the some API, where I pass single column, but receive couple columns(don't ask why it was implemented this way). So, I have a model(simplified for the example): class RentalFee(TimeStampedModel): public = models.BooleanField(default=False) required = models.BooleanField(default=False) name = models.CharField(max_length=150, null=True, blank=True) #... etc but due creation, I should pass the status with some string value: rental_fee = BookingsyncRentalFee(status='test', name='aaa'). Now I receive error RentalFee() got an unexpected keyword argument 'status' So, how is it possible to add the virtual column to the django model? PS: I know that it is no need to do anything, if I will pass the new column by setter, ie: rental_fee = RentalFee(name='some name') rental_fee.status = 'public' It works as well. I m interesting how to do same using init. UPD: I have found not very elegant way with just overriding init method: class RentalFee(TimeStampedModel): public = models.BooleanField(default=False) required = models.BooleanField(default=False) name = models.CharField(max_length=150, null=True, blank=True) def __init__(self, *args, **kwargs): status = kwargs.pop('status', None) if status: self.status = status super().__init__(*args, **kwargs) And it … -
django check the data in the fields if exists in another objects
I have some wonders if i can make an object with django and this object contains special fields which no other object can have : In my situation i have passengers ,flight , chair classes and i need the passenger can have only one chair in flight and chair can only be booked by one passenger and all related to flight so i can book the chair to anyone in another flight. in model.py class Passenger(models.Model): passenger_first_name = models.CharField(max_length=150) passenger_last_name = models.CharField(max_length=150) passenger_flight = models.ForeignKey(Flight ,on_delete=models.CASCADE) passenger_chair = models.ForeignKey(Chair, on_delete=models.CASCADE class Flight(models.Model): flight_name = models.CharField(max_length=150) flight_from = models.CharField(max_length=50) flight_to = models.CharField(max_length=50) aircraft = models.ForeignKey(Aircraft, on_delete=models.CASCADE) flight_Date = models.DateTimeField() class Chair(models.Model): chair_types = ( ("Economy", "Economy"), ("Business", "Business")) chair_name = models.CharField(max_length=50) chair_type = models.CharField(choices=chair_types ,max_length=8) in view.py def AddPassengerForm(request): form = PassengerTicketForm(request.POST) if request.method == 'POST': if form.is_valid(): if Passenger.objects.filter( passenger_flight=form.cleaned_data["passenger_flight"]) and Passenger.objects.filter( passenger_first_name=form.cleaned_data["passenger_first_name"]) and Passenger.objects.filter( passenger_last_name=form.cleaned_data["passenger_last_name"]): print("passenger's chair already booked") elif Passenger.objects.filter( passenger_chair=form.cleaned_data["passenger_chair"]) and Passenger.objects.filter( passenger_flight=form.cleaned_data["passenger_flight"]): print("chair already booked") else: form = PassengerTicketForm(request.POST) print("thank you for uos") context = { "pax_ticket_form": form, } return render(request, 'index.html', context) this method works very well but i would like to know if there is cleaner or better method to do that. I appreciate … -
Pass additional attribute to django-filter
I'm using django-filter together with DRF. I have a favourite-model, which is linked to several other models through a GenericRelation. To filter for entries which have a favourite-flag, I've created a custom FavouriteFilter, which I add to the respective model. I would like to query for the content_type_id of the respective model in order to limit the results from Favourite. However, I don't know how I can pass down the model to the filter-method in the FavouriteFilter. Here's a code snippet to illustrate the issue: class ProjectFilter(BaseFilter): favourite_only = FavouriteFilter() class FavouriteFilter(django_filters.BooleanFilter): """ A custom filter which returns a users favourites of an element """ def __init__(self, *args, **kwargs): # gettext_lazy breaks the OpenAPI generation => use gettext instead kwargs['label'] = gettext("My favourites") super(FavouriteFilter, self).__init__(*args, **kwargs) def filter(self, qs, value): if value == True: user = get_current_user() content_type = ContentType.objects.get_for_model(<model>) return qs.filter(pk__in=Favourite.objects .filter(owner_id=user) .filter(content_type_id=content_type) .values_list('object_id', flat=True) ) else: return qs In this example, the <model>-attribute is missing. How can I pass down this information from Project to the filter? -
ERROR in node_modules/stream-chat/dist/types/connection.d.ts
i follow this tutorial https://getstream.io/blog/realtime-chat-django-angular/ . I had been faced to an error while start the project by using npm-start command. I will show the error in below. enter image description here