Luis
Give me some minutes I have an example
Luis
Ooh let's try Michael's example. I'm afk and drinking some beer haha
Akshay
Experience django developer looking for job change in india, DM me
Luis
Can I show you an example?
I wrote an app that stores some email settings into the database. You can use different SMTP servers or accounts that way
Luis
How to dynamically change the mail sender in Django? I use send mail. Now the sender is always one - specified in settings in EMAIL_HOST_USER = 'test@gmail.com'
Use this in your settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' And then send emails this way: from django.core import mail from django.core.mail import get_connection def send_my_email(host, port, username, password, subject, body, from_, to_list): conn_params = dict( host=host, port=port, username=username, password=password ) email_params = dict( subject=subject, body=body, from_email=from_, to=to_list ) with get_connection(**conn_params) as connection: message = mail.EmailMessage(**email_params, connection=connection) message.send(fail_silently=False)
Luis
I didn't test that, but that should work.
Евгений
Luis
I forgot to include the send statement hehe
Luis
Sorry already had some beers 🥴
Luis
Thank you! I'll try!
Please, copy the code again. I changed from to from_ because from is a keyword in python
Henil
I have a problem in admin....i used custom admin but filter section is showing after added data.... how can i solve this ??
Luis
I have a problem in admin....i used custom admin but filter section is showing after added data.... how can i solve this ??
Is that a css issue? Check the template used by that customization and check where the block for filter is located...
Luis
Also take a look to the packager documentation
Henil
No i have not used templates for admin... i have customised just admin.py
Luis
Oh! Got it
Henil
What can i do??
Luis
I don't remember if the admin template is responsive. Might it be caused by a tiny screen?
Henil
I also have no idea
Luis
I also have no idea
Hmm... That's a problem. Try to hit Ctrl and minus key. The browser should zoom out the page and then you can use Ctrl and zero key to restore. If the page is responsive I think it will change on the fly
Luis
I don't think so
Not sure, I think that newer versions of Django use a responsive template
Henil
Yes it is responsive
Diego
god bless @LuchoUY
Luis
Yes it is responsive
Hmm... so if you zoom out the page that displays correctly?
Henil
No that’s a problem
Henil
In this group i am not able to send image
Diego
In this group i am not able to send image
I'm not able to send a sticker 😢
Luis
I'm not able to send a sticker 😢
Stickers are not allowed in this channel
Henil
Then how can o show you what’s the problem ?
Luis
In this group i am not able to send image
Upload image to a image service and then share the link
Luis
Please read the pinned message and channel rules 👍
Diego
Please read the pinned message and channel rules 👍
interesting, however, I believe stickers don't hurt anyone
Luis
interesting, however, I believe stickers don't hurt anyone
Yes, I agree. But I think that they add complexity when you're reading all the messages on the channel.
Diego
who's the winner?
Luis
Diego
Luis
Ok, it's 3:30 am. I'm going to bed. Hope someone here can help you Henil
Mohammad
const form = document.getElementById('contactusform'); form.addEventListener("submit", submitHandler); function submitHandler(event) { event.preventDefault(); $.ajax({ type: 'POST', url: "{% url 'home_page' %}", data: $('#contactusform').serialize(), dataType: 'json', success: sucessHandler, error: errorHandler }) } function sucessHandler(data) { if(data.msg === 'Success') { alert("Success"); $('#contactusform')[0].reset(); } } function errorHandler(data) { console.log("hi0"); if(data.msg === 'Error') { console.log("hi2"); alert("Error"); } }
d3vsh3d
Thanks👍🏻👍🏻
You are welcome
Shubhjot
Suggest me any django tutorial
Anonymous
https://pastebin.pl/view/de3ce80c i get invalid token header token should not contain spaces
Doragonsureiyā
Suggest me any django tutorial
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Mirco
https://pastebin.pl/view/de3ce80c i get invalid token header token should not contain spaces
Have you checked the request headers received by the backend with a breakpoint to check what has been received ?
Anonymous
yes
Mirco
yes
And ? What Django receives ?
Anonymous
it receves token but aut gives eror
Mirco
it receves token but aut gives eror
Yes but in which format ? Paste inside pastebin what Django receives exactly
Anonymous
django recives AuthFailure
Mirco
django recives AuthFailure
I mean the exact request headers Otherwise the problem is on how you get the token
Kinjal
Hello, everyone I am hiring Django mentors for my e-learning platform. Do let me know if anyone interested Thanks.
Deleted
Hey every, can delete a form table in django?
Doragonsureiyā
Hello, everyone I am hiring Django mentors for my e-learning platform. Do let me know if anyone interested Thanks.
Rule 🔟: Job-related offers are only allowed in the offtopic group. To not be considered spam, Job offers must include: • Skillset/techstack • Contact information • Brief job description • Pay figure • And can only be posted in @PythonOfftopic.
Kinjal
👍🏽
Shivam
How to add filed like image in django user creation form
@LSR
Anyone know about database many to many relationship
@LSR
Hey every, can delete a form table in django?
Delete from models and make migrations and migrate
Yash
Hello everyone, I'm new in django. Would anyone pls, help me to find resource of django.
python developer
Hi guys Anyone know Heroku fake credit card For sendgrid
Firdavs
hi guys why formset dosnt work
Emre
Does anyone have django rest framework documentation pdf version for hardcopy? Or any django rest framework book pdf version?
Anonymous
Any helpers pls , I am very much new to Django pls