Hojiakbar
how to connect to the site with python to get news ever
ERMIA
Dev
had to scale my django app database connection pool so i used
the connection pool option on digitalocean and now most of the page on my django admin
returns Error 500 and i see this as part of the error
django.db.utils.OperationalError: cursor "_django_curs_140571912341312_sync_43" does not exist
Hojiakbar
site have list products i need to connect to this and get info when it is change
ERMIA
Connect to where?
ERMIA
Your db?
ERMIA
Or external site?
Hojiakbar
Hojiakbar
when it refreshinig mine also
ERMIA
yes
You need websockets to have real time connection with your client
ERMIA
Or every 30s req backend which is not a good idea
Hojiakbar
have other way
ERMIA
Only way for real realtime connction is websockets it's simple
ERMIA
You need django channels
ERMIA
And socket.io or ws module in client side
ERMIA
have other way
Or in worst way request every minutes like (iranian goverment websites😂)
ERMIA
Or watch your database filesystem
ERMIA
There are many ways but standard is ws
A
Can any one tell how to use. MongoDB in django
A
And it is use Full or not
kumar
resources to start learning django ?
Doragonsureiyā
resources to start learning django ?
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
Barss
Friends, I really need help with deploying a Django project on a Linux server. I'm using the Oracle Cloud service. We have a Ukrainian project and the task is to create an informational bot for internally displaced people. Unfortunately, the project doesn't have a budget, only volunteer work. I've already written the bot and its Django admin panel, but I've been trying to deploy it for almost a week without success. Perhaps someone could assist me with this task?
Sina
Soham
Hello, i want to add objects detection from image with yolov5 , and want to integrate it with django, so anyone know the most efficient way to detect objects from a image in yolov5
Jack
Nat
Hello, I was using post_generation decorator in my ModelFactory, but during test, it's resulting unstable result. Sometimes the model created with factory will be encluded in Model.objects.all(). Sometimes it won't. What could be the problem
Erkaboy
Hi all. I need some advice.
I have driver's locations (lat,long). I used redis cache to save them. Now I have to find drivers in given radius. I go through to list again and again every time. I am going to know is there any better aproach for this. Thanks for answers.
123456
Help please
I'm building a Django based app and I was asked to do few steps in the project . First one was data base using models.py ( I also configured MySQL in settings.py
Second step I'm asked to do a data access layer ( using Django orm ) I know that DAL is used to interact with my database ( I was asked to use one class DAL based on CRUD for example to read customers update or delete and so on . So where and how do I work with the data access layer . Which file to implement it into ? Vies.py ? Any help is good
Thank you
M. Hossein
I use LoginRequieredMixin on my view which redirect user to login page if user is not authenticated. What I want is to modify login page context when redirecting. For example if user wants to see his/her profile and not logged in, redirect to login page and write "Please login first". How is this possible?
Muflone
M. Hossein
Muflone
How?
From the view you use request.GET.get('next')
부산
Hello, how are you! There is a Product model and there is a ProductImage linked by a foreignkey. How to write a form to add several pictures to 1 product?
Charly
Charly
123456
Since it's something related to database , is it a good practice to put in models ?
Business logic also goes inside models ... the file will be full of code . Not too much ?
Charly
Charly
add a new file
123456
부산
How can I write a form that allows me to upload multiple images at once?
Charly
𝔸𝟙𝕕𝕪𝕟
is mptt good for use?
부산
Charly
nothing working
We don't know what exactly your have done an how is it failing
부산
def clean_slug(self):
slug = self.cleaned_data["slug"]
if not slug:
name = self.cleaned_data["name"]
slug = slugify(name)
return slug
this is written in the forms.py but it is doing nothing. how can I slugify based on the name when I create a new product by without filling out slug field?
Derrick
Is your self. Cleaned_data dictionary preload and also check if it's empty or not
Никита
Hi all! Please tell me, I'm doing a 3-step registration, using 3 forms that inherit from ModelForm and view classes that inherit from FormView. The first two pages were ok. On the first, I write down the first name, last name, mail and number in the session. On the second, I confirm the mail using the code. But there is a problem with the third page. There should be two fields:
1) Enter password
2) Enter the password again.
And here in the form I don’t know how to make the password validation be from Django (well, that is, checking for length, characters, similarity between the first and second input field, etc.). Tell me, please, how to do this? From what class to inherit in the form?
Anonymous
I want to set an option for the user (employee) who is allowed to add the latest news and decisions and can modify and update them constantly
How can I do this?
Rev3rce
I don't understand the error in Django: Django.core.exeptions.Improperly.Configured, this is because of ..., include('account.urls')
Can anyone help me?
ᴋʜᴀʏᴅᴀʀᴏᴠ
I don't understand the error in Django:
KeyError: 'SECRET_KEY'
Maxim
123456
need help with fixing models.py if anyone up for it ?
i have been requested to make a project to handle flight search system . i took the liberty to fetch data from Amadeus API for real flights . when fetching the flights it's giving back information ( way more than i need , but some of the responses are useful and i've decided to use them into my project suh as terminal , grand_total , travelerType , currier_code,number and flight segments (which will show if the flight had a stop , if the flight is return , if the flight is one way )
my current models.py class that is taking care of this is class Flight :
class Flights(models.Model):
id = models.BigAutoField(primary_key=True)
airline_company_id = models.ForeignKey('Airline_Companies', to_field='iata_code', on_delete=models.CASCADE)
origin_country_id = models.ForeignKey('Countries', on_delete=models.CASCADE, related_name='origin_flights')
destination_country_id = models.ForeignKey('Countries', on_delete=models.CASCADE, related_name='destination_flights')
departure_time = models.DateTimeField(null=False)
landing_time = models.DateTimeField(null=False)
remaining_tickets = models.IntegerField(null=False, validators=[MinValueValidator(0)])
what would you do ? make another class or add fields to take care of the the data that's being returned from the API ?
akshay
Anyone can help me
KingFx
how to fecth data in a django app from a form in a react app
Yaroslav
Drf(django rest framework) or websocket
Morteza
Yaroslav
How it make ?
KingFx
User
How can I authenticate an user across multiple databases without configuring in settings.py
Doragonsureiyā
Алексей
Hello everyone, please help
User
What are you talking about?
This is the case I'm working with : i need to create a database whenever a new user gets registered. That database is specified to that specific user. In django there are multiple db concepts which we can configure in settings.py.
Karthik
Hello can anyone give me a suggestion recently I joined to a company I have 2 options I can learn Nodejs or Django, which one has more scope and more job opportunities ? and I heard that now a days all companies are using nodejs since they can develop both frontend and backend using javascript only
Naman
Eric
Eric
Karthik
Eric
User
Anonymous
Brothers any suggest a better youtube channel or any playlist to learn django from scratch
.
How to disable certain options of a ForeignKey field using crispy forms?
The form inherits a ModelForm, and the model has a ForeignKey to another related model.
I still want to display all related model instances as dropdown options, but disable certain ones. Modifying the queryset alone isn’t enough because I still want to display all of them, with only certain options shown as disabled.