{°_°}
How can I turn on status on view I wrote it like Def profile(request): Request.user.is_staff=True but it doesn't work?
cj
its possible if you dont sleep and complete the official tuts less than 3 hours. you can trust me coz i've been there
did you complete the tuts in less than 3 hours without sleeping to submit your project next day? 😱
007
😂😂😂
{°_°}
You have to call user.save()
Didn't do that I will try it now tnx
inchidi
did you complete the tuts in less than 3 hours without sleeping to submit your project next day? 😱
and the project have some rest api endpoints, i made it without drf 😎
inchidi
Does it possible do this statement in django???
you literally going back to this chat https://t.me/django/30690
Krishna Praneeth
hii is there anyone to help me
Krishna Praneeth
?
yeah i want to know how class based detailview works
cj
yeah i want to know how class based detailview works
what part of the documentation you didn't understand?
Guillermo
yeah i want to know how class based detailview works
https://docs.djangoproject.com/en/dev/intro/tutorial04/
Krishna Praneeth
what part of the documentation you didn't understand?
yeah i am doing twitter clone .so,in my app i want display detailview using class views and i want to get a particular tweet to be displayed. but i am unable to do that.
Krishna Praneeth
yeah i am doing twitter clone .so,in my app i want display detailview using class views and i want to get a particular tweet to be displayed. but i am unable to do that.
I saw a video in that he used class based deatil view and just included his model in his deatail view and he is able display object which ever tweet is requested
Trials
that's the problem of using "videos" to learn, instead of reading documentation 🤷‍♀️
Krishna Praneeth
okk
Krishna Praneeth
i am getting "MultipleObjectsReturned at /tweet/1/ " can anyone help me
Mirco
Your .get() returns multiple results instead of one
Mirco
Use filter() or check why you have two same records
Krishna Praneeth
okk
Guillermo
hey are you there??
dude, just send the problem 🤣
Krishna Praneeth
but I to want to sent single object only
Guillermo
but I to want to sent single object only
Its just like @iFlare3G told you, your get is returning more than one object, use filter or check why is there more than one object with the same value for the field you are using in .get
Krunal
request.session.get_expire_at_browser_close() where to use this on view.py Or on template
Himanshu
I want to build a website I know basics of python
Himanshu
What way should I follow to learn Django?
Himanshu
Okay thanks
Himanshu
Does it contain all the things required?
Himanshu
Can I use firebase database in Django web app?
cj
Can I use firebase database in Django web app?
yes you can, but better use PostgreSQL
007
What way should I follow to learn Django?
Also follow tutorialpoint django notes
Himanshu
yes you can, but better use PostgreSQL
But I want to connect that same app with an android app
Himanshu
So I want the data to be on cloud based database
Himanshu
Anyone who have some suggestions?
cj
So I want the data to be on cloud based database
well... yes you can use Firebase with Django, you just have to make some manual things (assuming that you know what you're doing, and you'll be fine)
Himanshu
Ohh okay
Himanshu
I did some tutorials back 5-6 months ago
Himanshu
From django girls tut and the new Boston
007
Ya Django girls also contain good stuff
Himanshu
But I always feel I'm like stuck in tutorials purgatory
Himanshu
One course after another
Himanshu
I do some courses like I did android first and then I did flask and django after that currently I'm working on machine learning but the problem is once I leave something it is gone after few months...
Himanshu
Anyone who feels the same?
007
Hold my beer... I have worked on angular and node js then again switch my profile to python and django
cj
Can anyone help me?
did you read documentation? what does it say?
Guillermo
Can anyone help me?
what are you trying to do?
Krunal
did you read documentation? what does it say?
Yes I gone through the documentation but still my problem is not resolved
Prince
Anyone give me idea for minor project in django for collage, please
Krunal
but... what does the documentation say about it?
I can able to clear session by request.session.flush() method on logout
Krunal
And then without login I can't access the page but it's work on proper logout method
Mirco
And then without login I can't access the page but it's work on proper logout method
What's your main goal ? Why do you want to clear all sessions ?
cj
I can able to clear session by request.session.flush() method on logout
https://docs.djangoproject.com/en/2.1/topics/http/sessions/ I hope you've read it
Krunal
What's your main goal ? Why do you want to clear all sessions ?
After login if I close the browser and trying to open direct URL it's accessible without login
Mirco
Ok ok gotcha 😁
Mirco
After login if I close the browser and trying to open direct URL it's accessible without login
https://docs.djangoproject.com/en/2.1/ref/settings/#session-expire-at-browser-close
Krunal
then you didn't protect your view correctly
I have make if condition on HTML template {% request.user.is_ authenticate%}
Mirco
Set this one in your settings
cj
In middleware
you don't like to read docs, do you?
Ajay
searching what?
I m doing e commerce website I need to search product from my database
Mirco
In middleware
Nope , at the end of your file