a
first of all, no code walls
secondly, rephrase your question
Марк
1) to explain I need to use a photo, if possible I can send examples in private messages
2) how else can I post code to explain the whole problem?
a
Doragonsureiyā
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like:
- https://dpaste.org
- https://hastebin.com
- https://bin.kv2.dev
If you posted a wall of text, go back and delete it.
Марк
Good day to all)
Help me solve the problem with a huge number of sql queries when opening an object in the django admin panel.
The problem is that my model has many other models associated with it and when I open this object in the admin panel, many sql queries are called, to get data about all the relationships with the object, I need to configure admin.py so that all this data django received for a small number of sql queries
https://dpaste.org/vhM0y
To administer the django database, I use 'django.contrib.admin'. Let's say I want to fix one of the objects of the Review model in the django admin panel, when clicking on the django object, it hangs due to its attempt to download all data from ForeignKey, that is, data about all related objects, which is why it does this suboptimally and sends several thousand sql queries, so I can't even open the page with the object in the admin panels, how can this be fixed so that django gets all the information without executing a huge number of sql queries
a
Good day to all)
Help me solve the problem with a huge number of sql queries when opening an object in the django admin panel.
The problem is that my model has many other models associated with it and when I open this object in the admin panel, many sql queries are called, to get data about all the relationships with the object, I need to configure admin.py so that all this data django received for a small number of sql queries
https://dpaste.org/vhM0y
To administer the django database, I use 'django.contrib.admin'. Let's say I want to fix one of the objects of the Review model in the django admin panel, when clicking on the django object, it hangs due to its attempt to download all data from ForeignKey, that is, data about all related objects, which is why it does this suboptimally and sends several thousand sql queries, so I can't even open the page with the object in the admin panels, how can this be fixed so that django gets all the information without executing a huge number of sql queries
is django sending the several thousand queries when you open the list of Model entries or when opening a specific entry?
Марк
2
Марк
https://*/api/admin/catalog/review/19/change/ here is a link that generates thousands of sql queries
a
raw_id_fields
autocomplete_fields
Марк
I think ModelAdmin is suitable for a temporary solution.readonly_fields
a
Марк
your suggestion, I haven't tested it, they don't sound exactly like a solution to the problem, but I'll try
Shivam
kim
How can I leave a message to the user after the data is successfully sent to the database
@
Any one does know mechine learning i has doubts please clarify
Abhi
Is there any other service for sending SMS in Django besides Twilio
Raj
Anyone looking backdoor jobs, please reach out to me personally, we have openings in Hyderabad and Bangalore locations in CMM LEVEL 5 COMPANY...
Chalaza
KAKASHI
Hello friends
Why doesn't the static files link correctly?
I have linked them with static but nothing change
I have setup the settings.py and I'm still getting nothing
Surya
Hy I'm new in group
Anyone can tell me how can i learn django anyone know about learning materials or resources
Luis
Surya
It's a website
Juan J
👋 Hi, Django community! 🚀
I want to share with you my new open-source project: Graphene Django Cruddals 🛠️. If you use Django and GraphQL, this might interest you! 🚀
🔹 What does it do?
It simplifies and speeds up CRUD creation in Django using GraphQL. It's easy to use and customizable.
🔗 GitHub Repo: [Graphene Django Cruddals](https://github.com/juanjcardona13/graphene_django_cruddals)
🔗 PyPI: [graphene-django-cruddals](https://pypi.org/project/graphene-django-cruddals/)
Your feedback and contributions are more than welcome. I hope you find it useful! 🙌
📬 Feel free to message me on Telegram: @juanjcardona13
Ashok
https://datascienceproject.in/jdbc
clouded
Abhi
a
The Inspired
The Inspired
It might give some better error messages
The Inspired
which will help in better debugging.
ȺʍìɾⱮօհąʍʍąժ
Hello, I am working on a project, and I need to implement an API for user password reset.
The problem is that when the user clicks on the link (the link is sent by the back-end), I should display an html webpage, but before showing the webpage, the client should send me a request so that I cofirm the link. But there is a problem, How should the url structure be ? Should the client  send me the base url in order that I add the token to the link ? Or is there a better way to implement this ? (When there is no API, I can implement that easily because the domain was obvious, but now I need to forward the user to the webpage, I need the domain, and the client should send me a request for verification)
luckyDev777
Hi everyone, can someone give a link to good public GitHub repo Django + Kafka app implemented as microservice?
cj
Yagi
Quick question: With QuerySets, you technically don't need to understand how SQL statements work because the API will handle that side of things?
a
a
some people call orms an anti pattern tho
a
this one for example
https://www.yegor256.com/2014/12/01/orm-offensive-anti-pattern.html
Yagi
I'm still new to the technology but thanks for confirming my suspicion!!! and I'll give the link a read!, Thanks !
Abdullo
ValueError at /addcourse
The view blogapp.views.Contact_Page_View didn't return an HttpResponse object. It returned None instead.
I am stuck with this problem
My view looks like this:
def AddCourse(request):
if request.method == 'POST':
form = CourseForm(request.POST)
if form.is_valid():
form.save()
return redirect("index")
else:
form = CourseForm()
return render(request, 'addcourse.html', {'form': form})
Abdullah
You are not returning any value
Abdullah
Write the last return statement as a function returning not in else block
ishaan
can we make APIs in django without using serializers? just returning as json response
The Inspired
ishaan
yes
then why we use serializers? I mean what's the benifit
ishaan
And is it good to use jsonresponse for api in big project?
Hrishi S Vijayan
ishaan
Hrishi S Vijayan
The Inspired
then why we use serializers? I mean what's the benifit
why do you use django instead of Spring?
for ease of use and automatic features, right?
same is the case with serializers. Why would you write your own data validation logic and repeat yourself when serializers do that for free for you?
The Inspired
And is it good to use jsonresponse for api in big project?
You can use it, but if you are using DRF, it is highly recommended to use the Response object.
Refer to the introductory (first 4 )paragraphs mentioned here:-
https://www.django-rest-framework.org/api-guide/responses/
In simple words, don't use JsonResponse unless you are forced to
Mohsen
Hey guys 👋
I'm almost finishing my project and I'm starting to write my unit tests
I found out I need to have about 300 test methods overall and I am the only developer here
You think it's necessary to write my unit tests by myself or I can use AI at this point?
乇PIPHANY❦▧▧❄️
good day folks
can I Iink an internal page from django using a urlfield using the admin page?!
for more clarity
I'm trying to provide a link on  the homepage where users can access the destination page from
and I want the super user or admin to be the one who provides those destination links to the pages when he wants
but it seems the urlfield can only take https:// links
and since the website isn't online
what can I do about it
or urlfield just won't work
if so
what will?
Mehdi
HI . i created model with blank and nul = true and use it as value in html but when user signup and try to use form it doesnt show html placeholder instead show None As Value , is there way to put blank and null = to nothing i mean ("") this not ("None")
Yagi
why does Django not accept Null values within a database?
m
Hi,
How much does real-time programming increase resource consumption compared to the non real time?
Is FastAPI better for this purpose than Django Channels?
a
a
fastapi is an api lib, django channels is a protocol extension lib for django
kaka
Hello everyone, I'm new to Django. I'm developing a Library information management system, I created a form for the users of the Library details. But then, when I enter use details, it doesn't save in my website, even in the Django admin interface, the informations I entered three doesn't save in my website. ANY HELP PLEASE 🥺
彡 اميہر
Can you source the Django project code for visual viewing and feeding?
Charly
M. Hossein
What's the best way to get objects based on year in django?
I need to get articles based on year (don't wanna use archive view)
Something like queryset[2034].first()
Mirco
M. Hossein
.get(year=2034)
Where year = your model date field
That's not what I'm looking for
Look I wanna show something like archive
Output I am looking for (just for example) is a dict
Each key is a year
Each value is a queryset or list of articles in that year
kaka
Mirco
Mirco
So you just need to use annotate() on created_at field and use values() to have a query dict
Mirco
You can see inside Django doc how it works
But basically you need a group by year
cj
John
The latest version of Channels does not support the ASGI development mode in runserver. What steps should I take?
t
hi everyone
i want to deploy django with docker on production and have problems with static files load can anyone help me?