Praver
Mahdi
class SetLastVisitUser:
def init(self, get_response):
self.get_response = get_response
def call(self, request):
if request.user.is_authenticated:
# Update last visit time after request finished processing.
user=UserCustom.objects.filter(id=request.user.id)
if user:
user.update(last_visit=now())
response = self.get_response(request)
return response
Hello
Friends, can anyone explain this to me?
Items init and call
Code to set the last visit of each user
Hamidreza
hi, i have a Django App with postgreSQL, and i got this error:
FATAL: sorry, too many clients alerdy
connected to django, postgresql, telethon
Raj__Django
favicon.io no web process running herko error
Raj__Django
When uploading to heroko
Raj__Django
Can anyone help me for this error
Raj__Django
And also after running heroku ps : scale web=1
It is showing couldn't find that process type. (web)
Alex
Yes, modern postgres and mysql both have jsonfield
Alex
Oh, better to check their docs - since when they support json type
Ujjwal
Any tried and tested video or content regarding deploying a django APIs on heroku
Ujjwal
I have been stuck for 2 days yesterday and day before yesterday . Watched many videos ..I am stuck ..so any good resource ???
Кирилл
Con you recommend db-pooling for oracle?
Кирилл
I've tried django-db-connection-pool, but for some reason it do not want to do autocommit as regular django oralce backend.
Sarthak
Hey any good developer looking to spend time on an amazing project
Sarthak
No cash
Sarthak
Only accomplishment
Sarthak
The project is about creating an ecosystem which people consider their home on the internet
Sarthak
DM to discuss
Sarthak
We will launch some apps which would be part of this home on the internet
Sarthak
One app has been launched already, but traction is poor right now
Sarthak
But the play is we atleast make 2-3 apps I have planned and then pitch to an investor
Sarthak
Showing that we are commited
Sarthak
Towards the project
Sarthak
Backend is in django
Sarthak
I believe in excellency, and if you believe in it too, and find less such environments around the world, we would be suckers for one another ...god vibes only
Sarthak
Let the messages continue boys
Alex
Sarthak good luck
Sarthak
Thank you so much need all that I can get😃
Sarthak
🙈
Manuel
please What am I doing wront
Manuel
wrong
Manuel
class LoginSerializer(serializers.Serializer):
mail = serializers.EmailField()
password = serializers.CharField()
print(mail)
def validate(self, data):
user_data = data.get("mail","")
password = data.get("password","")
print(user_data)
print(password)
if user_data and password:
user = authenticate(email=user_data,password=password)
if user:
print(user)
if user.is_active:
data["mail"] = user
else:
message = 'User is desactivated.'
raise exceptions.ValidationError(message)
else:
message = 'Unable to login with given credentials.'
raise exceptions.ValidationError(message)
else:
message = 'Must provide username and password both.'
raise exceptions.ValidationError(message)
return data
Manuel
I'm putting the mail and the password it needs to login and it doesnt work
Manuel
please help
Ghorz
Manuel
ok ok
Ghorz
Also paste the errors log
Manuel
I got no errors just None
Manuel
when I do authenticate
Manuel
and I don't understand
Ghorz
Manuel
ok let me do it
Manuel
https://pastebin.com/Ji0KKGNV
Manuel
tell me if it is OK
Manuel
I want to authenticate by emails not by username
Manuel
because I got multilple users with the same username but with differents domains
Manuel
that's why I wanna do it by emails
Anonymous
If you have done it correctly, please guide me as well. thknx in advance..
Focky
cj
how come you can't find it? you posted the link to the book
Hamidreza
Hamidreza
Hamidreza
🧐
Nice
How to delete your project entire query set ???
Nice
Can anyone suggest me how to delete entire query set from your django project
Anonymous
Hello everyone is there any free course where i can learn how to create a saas platform web application from start to deployment along with testing in django . Please suggest me.
Anonymous
Anonymous
Nice
Anonymous
Nice
So I can rewrite my query in django
Nice
Yeah
Anonymous
Just do python manage.py flush
Anonymous
It will prompt for permission give yes
Nice
I'm creating a blog so there is a bug ,
I think my some of my query sets are mistak so , I want to rewrite my query
Anonymous
It will delete all ur db data , do it if u r not in production . Its quite risky
Nice
Nice
I'm creating a blog project
Nice
Nice
Means ORM
Nice
Ok
Nice
Thnx bro 👍✒️
Anonymous
Neo
can we able to store logs based on the particular columns values changes in django