The run menu simply calls the "python" executable so you can use python 3 by changing your python executable to the python3 one. You can do this by running the following:
$ sudo mv /usr/bin/python /usr/bin/python2 $ sudo ln -s /usr/bin/python3 /usr/bin/python You can confirm it worked by typing: $ python --version Now when you press run it will run using python 3.
Sending emails with Django its quite easy, you just need to edit your project settings.py and add:
#SMTP Server configuration EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = '[email protected]' EMAIL_HOST_PASSWORD = 'your_password' EMAIL_PORT = 587 EMAIL_USE_TLS = True then save it and open a python terminal by running: >>> from django.core.mail import send_mail >>>send_mail('Django mail', 'This e-mail was sent with Django' , '[email protected]', ['[email protected]'], fail_silently =False) after if you get back "1" everything went ok. You May need to enable access for less secured apps at https://www.google.com/settings/security/lesssecureapps. |
Archives
August 2018
Categories |