Doragonsureiyā
The Inspired
yes
Anonymous
what's wrong?
Anonymous
How to filter model in html template?
Oleg
Hey. Can anyone share some interesting and hard technical assignments on DRF. Not interested in blogs/social media, want to implement something like celery tasks etc.
Only for education purpose
Fil
ZeroCool
Hi, does anyone have a tutorial to create your own user manager, without using the django manager? I would thank you a lot
M
KD
muhammad
hey guys, I wanna ask if is it possible the django admin panel is used as a dashboard for another app for example nodejs, so the admin panel is able to do the CRUD process?
Nazim
Эндейл
How can I filter objects on templates(bootsrap)by dropdown
Riad
which free hosting is good for django? I wil use django only for API server, no html templates. Is the platform render good? or there are more good alternatives?
muhammad
Nazim
Nazim
muhammad
svmr
What is the best way to check if queryset is empty?
queryset = Model.objects.all()
queryset.exists() or queryset?
Oleg
Oleg
Mirco
Oleg
if queryset:
...
This one will be useful if you still need to evaluate your queryset data;
queryset.empty() is useful when you don't need queryset data and just want to check its emptiness, then it'll be faster
svmr
..
Guys how to deploy my django app to vercel server properly
..
I uploaded it has crashed with 500 error. I checked the logs it says white noise didn't find smth app or handler
..
I checked on the stackoverflow advice was to modify wsgi.py like append app = application field i did it nothing changed
Anonymous
Anybody can tell how to make format of rest api in dictionary, by default it is list of dictionary
Kush
I have written everything properly but still output is not visible what should I do?
Maxim
Kush
I have added {%csrf_token%} still getting error of csrf
Maxim
Kush
Error : Did you forget to register or load this tag
Aamer
You have to leave space between {% csrf_token %}
Riad
Anonymous
def show_post(request, post_id): posts = Post.objects.filter(id=post_id)
form = AddCommentForm() comments = Comment.objects.filter(post_id=post_id)
if request.method == 'POST': form = AddCommentForm(request.POST, initial = {'user':request.user})
if form.is_valid(): comment = form.save(commit=False)
comment.user = request.user comment.post = Post.objects.get(id=post_id)
comment.save() try:
return redirect('pols:post/') except:
form.add_error(None, 'error') context = {'posts': posts, 'form': form, 'comments': comments}
return render(request, 'post.html', context)
Anonymous
how to do redirect
0100011001011001
hello i made a syntax error here how can i fix it : def perform_create(self, serializer):
content_type = ContentType.objects.get_for_model(self.request.data.get('content_type'))
serializer.save(user=self.request.user, content_type=content_type, object_id=self.request.data.get('object_id'))
Anonymous
how to do redirect
path('post/<int:post_id>/', user_views.show_post, name='post'),
Georg
hello. How can I set an order for urls if I use a router from restframefork ?
Georg
I need it because I have two similar urls: "model/(?P<codename>\w+)" and "model/dictionary".
So if I use router then django "thinking" that in model/dictionary dictionary is a codename pattern
Hamad
Can someone please advise me on how to make a dynamic dropdown list in a Django form based on previously selected models for dropdowns?
Artem
#help
Does anyone know why the form does not save data to the database? The validation passes, but the data is not saved, and no errors occur.
Qureshi
Couldn't access the URL //www.postgresql.org/applications-v2.
Qureshi
Anyone help me please how to stack builder postgresql download
Jamshid
#help
I've Question and QuestionOption model,
I should validate Question options
I tried with signal but could return ValidationError in signal
and another way clean method in model it checks only previous saved objects not current ones
please guide me if someone did such staff before
P.s: I'm adding question options at a time via django admin panel used nested admin models
Jamie
How to create 1000000 random data
Jamie
On django
Maxim
Jamie
In views views
Charly
Jamie
Charly
Doing a project
You need to be more specific because creating random thing on the views is not common, but there are many tools to create objects for testing
Charly
What?
Jamie
Charly
Okay
If you delete messages no one will dare to help you
Jamie
Which tools are available
Jamie
Jamie
Create 1000000 products ( you can use some python script to generate random data)
Jamie
Database table
Product (Id, shape,size, location,price)
Charly
Jamie
I can do it on model
Charly
Jamie
Where should I write the code for it
Jamie
In my database table
Jamie
I want to show it on my ui
Jamie
Thank you
zor
hello Friends, I'm working with Celery, but I don't get output, is the problem with Celery or Redis or...?