The Inspired
yes
Anonymous
what's wrong?
Doragonsureiyā
what's wrong?
What are you talking about?
Anonymous
How to filter model in html template?
Mirco
How to filter model in html template?
Filter backend side and inject via context
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
ZeroCool
Hi, does anyone have a tutorial to create your own user manager, without using the django manager? I would thank you a lot
Martin
Ok thank u ..let me try
Try signals Or creating a middleware
KD
Hey anyone how to create multiple user ?
Send me sample code file. If possible
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?
Эндейл
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
It's easier to create separate admin panel for node js
but essentially it's possible right?
Nazim
but essentially it's possible right?
Maybe yes but i think that it will take too much time
muhammad
Maybe yes but i think that it will take too much time
hmm interesting...could you tell me why? because now I think that since the nodejs app is connecting to the database so the panel itself will also directly control all of the data from the database
Nazim
hmm interesting...could you tell me why? because now I think that since the nodejs app is connecting to the database so the panel itself will also directly control all of the data from the database
django admin panel was created to manage django project. I think that all you need is an admin template. You can take any react or vue template and connect it with your node js using api
muhammad
your node js app and django app uses the same database?
since I thought that the django admin panel will handle my nodejs app data, so why don't I connect the django itself to the nodejs database
muhammad
django admin panel was created to manage django project. I think that all you need is an admin template. You can take any react or vue template and connect it with your node js using api
yessir..I do need the admin template, but since the django has the admin panel that's why if it's possible that I use that dashboard as well
svmr
What is the best way to check if queryset is empty? queryset = Model.objects.all() queryset.exists() or queryset?
Oleg
What is the best way to check if queryset is empty? queryset = Model.objects.all() queryset.exists() or queryset?
Check also https://docs.djangoproject.com/en/dev/ref/models/querysets/#exists
Mirco
What is the best way to check if queryset is empty? queryset = Model.objects.all() queryset.exists() or queryset?
if queryset is better, otherwise another stupid way is: queryset.count() == 0
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
..
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?
Kush
I have added {%csrf_token%} still getting error of csrf
Kush
Error : Did you forget to register or load this tag
Aamer
You have to leave space between {% csrf_token %}
Yasin
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?
Not entirely free but you get 100usd when you sign up for Linode then use it for 2 months. It is very good to start with. You can also use marketplace to use an image with openlitespeed django
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
Jamie
In views views
Jamie
in the loop
Can you give some overview
Charly
In views views
Why do you need that?
Jamie
Why do you need that?
Doing a project
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?
Charly
Okay
If you delete messages no one will dare to help you
Jamie
Which tools are available
Charly
Which tools are available
EXPLAIN your full problem
Jamie
Create 1000000 products ( you can use some python script to generate random data)
Jamie
Database table Product (Id, shape,size, location,price)
Jamie
I can do it on model
Charly
I can do it on model
Why in models?
Jamie
Where should I write the code for it
Charly
Where should I write the code for it
Where do you need it? Is just a single time to create it?
Jamie
In my database table
Jamie
I want to show it on my ui
Charly
In my database table
https://github.com/model-bakers/model_bakery
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...?
Charly
hello Friends, I'm working with Celery, but I don't get output, is the problem with Celery or Redis or...?
Impossible to know as we don't have any details also celery is best used for async task so you don't need to wait for the result