Doragonsureiyā
Let's play Django... Who's in?
Looks like you need an offtopic group, please continue this conversation at @PythonOfftopic
Anonymous
Ok... I drop it then
Alex
Let's play Django... Who's in?
There, go play https://django.cloud.homelabs.at/
Kushal
How to import A app's model in B app model?
Rohan
How to import A app's model in B app model?
In B, from A.models import (<models>)
Kushal
Thanks sir
Manish
How can I apply sms API in my project
Anonymous
Hi, could you watch my gist: https://gist.github.com/navifundendi/8ef9075c99a55fb732745164464d1509 if q = car, red I get a post with tags car, red. It's good. But when q = red, car I get a post with the tags car, red and post with the tags airplane, red, instead of a post with the tags car, red. It is not right. I am trying to do an exact search. Could you share your experience and tell me what the error is. (A similar search model logic at pornhub and rule34).
Anonymous
I expect to get the result sql analog: select p.* from Post p where exists ( select * from PostTags pt join Tag t on pt.tag_id = t.tag_id where pt.post_id = p.post_id and t.name in q );
Anonymous
By the way, this works correctly in django admin. Is it possible to copy the search method?
Sarang
Hi, please give me some tutorial or link 1) how to create api to login apis to api ( in django) 2) get server list
Sarang
localhost:port is also api or it only django web server ?
Sarang
It's Django development server
ok so for API i need to work on django rest framework ..right
Sarang
api and rest api is same or different ...
Sarang
because questions is create api server to login apis to api
Mirco
api and rest api is same or different ...
How can you create a login APIs if you don't have an minimum idea of what API is ? I strongly suggest you to study what's an API, what are the different types etc. etc. before creating something you have no idea what it is
ᐯᑌᏞᏦᗩᑎ📈
What to write for EMAIL_HOST_USER and EMAIL_HOST_PASSWORD?
ᐯᑌᏞᏦᗩᑎ📈
Registered user's email and password?
Mirco
Xeyyam
i am getting "'Response' object is not subscriptable"
Xeyyam
city_weather = { 'city': city, 'temprature': r['main']['temp'], 'description': r['weather'][0]['description'], 'icon': r['weather'][0]['icon'], }
Xeyyam
in this code
Xeyyam
can anybody help?
✙Yaroslav
Nope, credentials of your mail server
Can I change a mail server? How?
Mirco
Can I change a mail server? How?
By editing those settings
✙Yaroslav
By editing those settings
How to do it from custom templates?
Mirco
How to do it from custom templates?
Templates is the presentation layer
Anonymous
How to use multiple models in search??
Mirco
I know
So you have the answer for your question
✙Yaroslav
Templates is the presentation layer
I paraphrase. How do I change my mail not in code, but to make it available for editing from a template? how to realize it? I understand what it is in the views.py file to do, how?
Moe (محمد)
Hello, im retrieving information from an API and i want to save it in a model, but i dont want to call the api everytime the page reload since the information doesnt change that often. What is the best way to do it?
✙Yaroslav
If you mean your user's email saved into a model, you need a simple form and update it into the view
No. In settings.py I have EMAIL_HOST_USER="mymail@gmail.com" and EMAIL_HOW_PASSWORD="my password", as I understood, this is a const value.
✙Yaroslav
And my question, How to change this data from a template?
✙Yaroslav
Or this impossible?
Mirco
Ok so you said that is a "const" , constant means that it's something that doesn't change You can use django-constance to create some configurable settings by Django admin panel
Mirco
But this is not the scenario, EMAIL_HOST_USER usually is configured by using environment variables
✙Yaroslav
is analogy absent?
ᐯᑌᏞᏦᗩᑎ📈
Guys i am doing password reset and it was almost successful I am not getting any error but email doesn't pop in in my inbox
Mirco
is analogy absent?
Why would you let a user change a configuration of your infrastructure ? It doesn't make sense
✙Yaroslav
Why would you let a user change a configuration of your infrastructure ? It doesn't make sense
When I deployed the site, the only mail-account will be written on the back, and if I need to change it? How am I gonna do this?
✙Yaroslav
Will be written ? But that email is not the one who will receive user's emails
Yes, I know. not that who will receive it, but who will send. Here I ask how to make it possible to change the sending mail?
Mirco
Yes, I know. not that who will receive it, but who will send. Here I ask how to make it possible to change the sending mail?
Who will send depends on what you pass to the Django send mail util That settings doesn't refer to the sender of the mails
Mirco
https://docs.djangoproject.com/en/3.0/topics/email/#send-mail
Mirco
The from_email param
Mirco
You can change it into a view and "raise" the change from a template
Mirco
I can't open a link
Look for it on Google
✙Yaroslav
Look for it on Google
I didn t find what i needed
✙Yaroslav
You can change it into a view and "raise" the change from a template
Can I override this setting? EMAIL_HOST_USER and EMAIL_HOST_PASSWORD?
Ada
Hello guys, Anyone has any idea on how to come up with a biometric authentication system (system) using Django? Main issue being the code that reads, saves to db and does real time matching of the fingerprints.
✙Yaroslav
For example: user_email = User.objects.get(email_admin) user_password = User.objects.get(password_admin) EMAIL_HOST_USER = 'email_admin' EMAIL_HOST_PASSWORD = 'password_admin'
Mirco
For example: user_email = User.objects.get(email_admin) user_password = User.objects.get(password_admin) EMAIL_HOST_USER = 'email_admin' EMAIL_HOST_PASSWORD = 'password_admin'
You don't need to ovverride them Set them based on your mail server If you wanna send an email with the email_admin, you just need to pass user_mail to Django's send_mail util and specifically the from_mail parameter equal to your user_mail
Mirco
!yw
Doragonsureiyā
You're welcome! 😊
✙Yaroslav
!yw
Maybe are you have a example?
Mirco
But... How?
Please go into django official docs, you will find everything
Anonymous
"GET /static/js/main.js HTTP/1.1" 404 1656
Anonymous
help me plis
Anonymous
guys
Anonymous
my app web, don't found file static
Muflone
my app web, don't found file static
Ti serve static files is a web server duty, not Django's Read documentation
Anonymous
😂
Anonymous
sorry
Anonymous
i have this configuration in the setting.py STATIC_URL = '/static/' STATICFILES_DIR =( os.path.join(BASE_DIR,'static'),
Muflone
that's pretty pointless, django doesn't serve static files apart in the development mode
Muflone
you have to set your web server to handle /static and avoiding to ask your web app to serve them (and your app won't serve them, if you misconfigured your web server)