Partha
Məhəmməd
def vote(request, question_id):
question = get_object_or_404(Question, pk='question_id')
try:
selected_choice = question.choice_set.get(pk=request.POST['choice'])
except(KeyError, Choice.DoesNotExist):
return render(request, 'polls/detail.html', {'question': question,
'error_message': "You didn't select a choice"})
else:
selected_choice.votes += 1
selected_choice.save()
return HttpResponseRedirect(reverse('polls:results', args=(question.id)))
Partha
Məhəmməd
it says problem is in this line: question = get_object_or_404(Question, pk='question_id')
Anas
Any 1 did cascaded dropdown in Django?
Məhəmməd
Josh
Hello Community version is free for download
Mehmet
Never
I am porting from django 1.8 to django 3.1,i am having some problem with Middleware, systemcheckerror are shown,admun.E408,409,410,while i have done it right
Never
Anyone?plz
Tamim
Alejandro
hi ... you know how i could export a pdf containing graphics
Alejandro
?
Ghorz
Alejandro
thanks
Stump Lowell
Hy
Stump Lowell
Please can I get some help here
Stump Lowell
Ok
Stump Lowell
I want to display a human readable error if a user try to log in with wrong credentials
Stump Lowell
Is not seeing the validation error I set on the forms.py
Each time I put in wrong details it raise a value error instead
Object dint return an http response return none instead
Anonymous
Happy day to you all
Anonymous
I am beginner. Is it good to learn Django alone or something with that. Like rest...
WhiteDevil
It is better to understand front end technologies such as React, Vuejs
Akash N
What are the changes required in html to connenct in mysql database in Django
Vishal
Pycharm can be downloaded for free community version from pycharm official website
There is no requirement of license or crack to use community version it's sufficient to learn
Abrar
Karthik
How slove type error
Georgi
How slove type error
By changing a type of variable probably. If you need float from int, you do float(variable_that_is_int) or vice versa- int(variable_that_is_float)
Velociraptor
Dear all,
Velociraptor
I want to add form that create child from the already opened parent page? parent-child[one to many relationship]
Velociraptor
how to do it?
Velociraptor
share links if there any ... or search key words.. i tried my level best but coulnt find relevant resources.
Gil
Hi!! About email to admins Django 3.1
I have configured DEFAULT_FROM_EMAIL, but seems that django.core.mail.mail_admins() no using it, says root@localhost
Anyone with exerpience in that?
Gil
Дауран
hello i have such as issue un my django project , when i created 2 DetailView , AttributeError: type object 'Article' has no attribute '_default_manager'
Дауран
Manish
Hey, Can anyone help me with this:-
https://pastebin.com/CTP7W4Dw
Manish
👆I am trying to display single data obeject on my webpage, without using any loop
Anonymous
Can someone send their own project which created by Django ?
Mirco
Anonymous
I know it
Anonymous
But I am asking here
Anonymous
Among us
Anonymous
If they have
Mirco
what does it change ? maybe on GH you will find projects of someone that is here by yourself
Manish
https://stackoverflow.com/questions/63522446/how-to-access-specific-object-from-the-database-in-django-to-display-it-in-the-w
Mehmet
Manish
Mehmet
Is there an exception in Sqlite?because I have just tried here on MySQL and lazily executed with offset expression such below.
Mehmet
Item.objects.all()[2] creates sql below
SELECT orderapi_item.id, orderapi_item.created_date, orderapi_item.last_updated_date, orderapi_item.transaction_id, orderapi_item.order_id, orderapi_item.item_type_id, orderapi_item.title, orderapi_item.description, orderapi_item.seller_user_id, orderapi_item.buyer_user_id, orderapi_item.listing_id, orderapi_item.creation_tsz, orderapi_item.price, orderapi_item.shipping_cost, orderapi_item.quantity, orderapi_item.product_data_base FROM orderapi_item LIMIT 1 OFFSET 2; args=()
Mehmet
I dont know whether sqlite supports OFFSET cursoring like above
Manish
Yes, it's showing Django: TemplateSyntaxError: Could not parse the remainder......
Mehmet
Why dont you try to extract single row in view layer and by then send that with context?
Mehmet
Template layer is more error prune these kind of business logic overloading.
Mehmet
Extract all needed in view(like controllers on Java, .Net etc.) then send to presentation.
Manish
Raju
I'm new to djnago rest framework.
this is my model: https://pastebin.com/fneJpAfW
I'm trying to create a serializer. but i want to filter the category field with request.user and i want do it from serializer. that means the user who is creating new item only can see the category he added not all the category.
Sorry for my broken English
Mehmet
Yeah if nothing works. i will prefer this way.
That is a definite best practice in MVC or MTV structures. There are some occasions such as Model.NotFound exceptions for these kind of offsetting. How do you plan to manage that on Template layer? Will you search a way to exception handling on the template?
Anonymous
I am going to make a website with payment functionality. Can I django it can be secure or not
Mr Intruder
Hey guys I'm doing a project in python and django but i don't know how to use OOP in that project if anyone is here for this problems solution...
Anonymous
Mr Intruder
Is there any good channel which you prefer?
anonymous
Anonymous
Дауран
I meant on articles or news blog
Anonymous
Mr Intruder
Anonymous
Anonymous
Mehdi
Hi
whats the best video course until you are see for learning django?
Mehmet
Every modern framework is able to fulfill all concerns about integrating payment functionality.
Mirco