Siya
Hey i am doing the same. Which resources are you following?
Fan / Ac
check this https://realpython.com/manage-users-in-django-admin/
Fan / Ac
read django documentation tutorial
Monil
In django when i run test case I got address already use OS error
Any idea how to solve it?
Sergey
Hi anybody meet such problems with m2m fields like this? And how to solve such problem?
IntegrityError at ...
update or delete on table "table1" violates foreign key constraint "cons1" on table "midle_table_for_m2m_field"
DETAIL: Key (id)=(1) is still referenced from table "midle_table_for_m2m_field".
Rajnish
Hello there,
I am new to Django.
Need some help.
I am creating a sign up form (Register an user)
It takes Username, email id and password.
But i am getting this " given username must be set" error.
If I assign email id in the place of username it work perfectly , that time we can log in with the email id only.
But i want the log in through user name.
Kindly help how can I solve this error.
# I have tried to print the username before creating the user.
# have tried to use pdb
But didn't work any of them.
Please help
Codes link 🔗 : https://www.codepile.net/pile/q9bndZ9V
eugene
(⌐■-■)
Hello.
I am making a project in which there are cards that have to be arranged into a grid of 4 columns. I am passing the labels for the cards using context and the cards are getting arranged in a single row. How to convert this row to grid?
X X X X X X X X X
to
XXXX
XXXX
XX
Сергей
hello, can whoerver explain, for what does django need it?
https://docs.djangoproject.com/en/4.0/topics/migrations/#custom-serializers
when is it use or when is it usefull?
Manu
I am trying to make an add to cart button and the issue is my data after clicking on add cart button is not getting saved. Please check my code and help.
(⌐■-■)
Paul
Jitendra Kumar
Eslam
Guys how i can Show most viewed near product
Anonymous
Hello, I am Sukalyan, from India.
I am new in Django. So can anyone give me any suggestions for develop my skill in this field?
Heet Raval
Anonymous
Who can help me in django please
Doragonsureiyā
Who can help me in django please
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z!"
Just ask directly! The better you are at explaining the problem, the more likely you are to get help.
Asking smart questions
Ilsaf
What type of methods I should use in CBV, static or non-static?
Hossein.A
👑 Dharmzeey
Akash
The problem is with the authenticate()
Its not comparing the username and password
Doragonsureiyā
The problem is with the authenticate()
Its not comparing the username and password
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain:
- what you're doing
- what you're expecting
- what you're using
- where you're running the script
- what Python version you're using
- what packages and their versions you're using
- and the most important thing: show the code YOU wrote (read rule 5️⃣ for that)
and more details, that way your chances to get help will increase
Javokhir
ogassi
Hi, can somebody suggest good docx to html converter in python please?
Hossein.A
Hossein.A
ogassi
ogassi
The only thing that works fine is cloudconvert SDK, but its not free
ogassi
and i would like to know what they are using , to cinfigure the same in my project
Hossein.A
I have no idea anymore:)
ogassi
Mani
hey, there's so many IDLE connections that django ORM leaves behind in one of my project, in the other ones, it's fine. both are using same postgres server, and I don't understand why this happens.
I've set my connect_timeout to 5 secs, and CONN_MAX_AGE to 0
Alex
Alex
Normally django ends all db connections after it complete an http cycle
https://github.com/django/django/blob/7119f40c9881666b6f9b5cf7df09ee1d21cc8344/django/db/__init__.py
Mani
Such problems are hard to debug, because there are many reasons for that. You have to explain your project setup - who is using the DB, how my apps consumes it, how many processes those apps have and etc etc.
I'm using a PaaS service, I have 2 django projects on 2 servers, that both are connected to a postgresql v11.
The database has 4GB ram, 2 core CPU, meanwhile each server has 2GB RAM with 1 core.
As explained, I set CONN_MAX_AGE to 0, and connect_timeout to 5. few days back, it was all fine, but now, with one of my project, there are usually 60 connections in IDLE, and 1-2 active connection. in the other application's database, according to pgadmin, there's 0 idle connection, with 1-2 active connection at max.
These IDLE connections has been remained from serval hours ago, and I need to terminate them manually, otherwise I get the error "fatal too many clients"
Prathmesh
How to display image from database using ID in django
Prathmesh
??
Anonymous
Prathmesh
Yes
Anonymous
Yes
It is stored inside the hard drive
Prathmesh
It is uploaded successfully
Prathmesh
Yes
Alex
I'm using a PaaS service, I have 2 django projects on 2 servers, that both are connected to a postgresql v11.
The database has 4GB ram, 2 core CPU, meanwhile each server has 2GB RAM with 1 core.
As explained, I set CONN_MAX_AGE to 0, and connect_timeout to 5. few days back, it was all fine, but now, with one of my project, there are usually 60 connections in IDLE, and 1-2 active connection. in the other application's database, according to pgadmin, there's 0 idle connection, with 1-2 active connection at max.
These IDLE connections has been remained from serval hours ago, and I need to terminate them manually, otherwise I get the error "fatal too many clients"
My best guess - are you using celery or some other similar framework? Or maybe some 3rd party app? Are those connections attached to your server processes?
Prathmesh
It is image of product.
How to use product ID to display image??
S.H.K
Django is suitable for how many users
Mani
I've to mention that my CONN_MAX_AGE was about 60, before.
but then, after getting this problem, I lowered it to 0, to close all. connections right after the response is sent, but for some reasons that I don't understand ,this doesn't happen.
Naveen
How to host django project in vps Linux server
Naveen
Without cpanel
Naveen
@T4P4N
Doragonsureiyā
@T4P4N
Don't tag people randomly, even if they seem knowledgeable. Most of the time, the person you tagged doesn't even know about the topic you just brought up. If people want to help you, they will - just be patient.
Mirco
you cannot, you can deploy it a frontend app made in React / Vue etc etc powered by Django as backend, but not Django itself
Anonymous
Please who have knowlage about IOT nd django
Doragonsureiyā
Please who have knowlage about IOT nd django
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z!"
Just ask directly! The better you are at explaining the problem, the more likely you are to get help.
Asking smart questions
Рома
Hello.
I dont have much experience.
Is there is some builtin opportunity to get next row from table?
Example:
class Image(models.Model):
id = models.BigAutoField(primary_key=True)
image = models.ImageField(upload_to=image_directory_path, blank=False)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
class Meta:
order_with_respect_to = 'id'
Рома
image = Image.objects.get(id=1) # got image here
next_image = image.get_next_in_order() # got Image matching query does not exist
# next_image = Image.objects.get(id=2) # direct request by id got it
Fan / Ac
Рома
if i right understand your question. As i know, get returns object, not queryset. Should i apply filter?
Fan / Ac
i think what you need to do is sort by created date in ascending order
Рома
i dont need all. I have some concrete and i want to get next to it
Kiarash
Hi , can you introduce some good intermediate/advanced django books ? 👍
Fan / Ac
and iterate through the generator it return
(⌐■-■)
Рома
and iterate through the generator it return
Your solution is helpful. A bit not what i was looking for.
Result (as i know current id)
image = Image.objects.filter(id__gt=1).order_by('created')[:1]
Can it be improve? Or it is ok?
Kaveri
Can we use django to read content from Google docs if yes then how to do that ?
(⌐■-■)
Kaveri
Can you please tell the steps briefly
Doragonsureiyā
Can you please tell the steps briefly
You seem to be confusing this chat for a search engine.
Step 1: Open a browser
Step 2: Write down https://google.com or https://duck.com and press Enter
Step 3: In the search box, write down the same words you asked here
Step 4: Read the first results