Separating remote vs local settings.py parameters - - “EMAIL”?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Separating remote vs local settings.py parameters - - “EMAIL”?

drone4four

If you take a look at this gist provided by a Udemy instructor and at this specific location, here he wisely recommends separating important local development configuration parameters, such as SECRET _KEY. Of course everyone knows how stupid and foolish it would be to share the SECRET_KEY publicly on GitHub and then to use it in your production environment.


So here is the list of parameters to place in the separate remote settings.py as it appears in that gist linked to above:


  • SECRET_KEY

  • ALLOWED_HOSTS

  • DATABASES

  • DEBUG

  • EMAIL_*


If you look at the last one, it says: “EMAIL_*”. What do you people think the “_*” suffix? Is this standard for settings.py configurations? Or would you people think this is just a glaring typo on the side of the instructor?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Separating remote vs local settings.py parameters - - “EMAIL”?

aishtiaque
The character "*" represents "wildcard". Here is the real reason why the instructor puts it that way: https://docs.djangoproject.com/en/2.1/ref/settings/#email-backend

There are a lot of variables that contain the 'EMAIL_' prefix, which is why the instructor wrote it that way.

On Fri, Mar 15, 2019 at 8:16 PM drone4four <[hidden email]> wrote:

If you take a look at this gist provided by a Udemy instructor and at this specific location, here he wisely recommends separating important local development configuration parameters, such as SECRET _KEY. Of course everyone knows how stupid and foolish it would be to share the SECRET_KEY publicly on GitHub and then to use it in your production environment.


So here is the list of parameters to place in the separate remote settings.py as it appears in that gist linked to above:


  • SECRET_KEY

  • ALLOWED_HOSTS

  • DATABASES

  • DEBUG

  • EMAIL_*


If you look at the last one, it says: “EMAIL_*”. What do you people think the “_*” suffix? Is this standard for settings.py configurations? Or would you people think this is just a glaring typo on the side of the instructor?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKizqR7JGGJyD9c7AXG%3Dun%2BL7dNsknE2XF_xC2r%3D0x2%2BRmzueg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Separating remote vs local settings.py parameters - - “EMAIL”?

drone4four

So the remote server production email contact information could be different from the developer’s testcase email contact info?


I’ve taken a closer look at the “email-backend” section of the Django docs that you’ve linked to, Ahmed. I see Django supports email settings.  I don’t really understand what these EMAIL parameters would be used for. For example, EMAIL_BACKEND says:


Default: 'django.core.mail.backends.smtp.EmailBackend'
The backend to use for sending emails. For the list of available backends see Sending email.

I followed these two links and it is still not clear to me: Are these email settings only used if I implement SMTP or other email services?


Would it be OK for me to just exclude altogether “EMAIL_*” until I reach a point when there is a need for an SMTP server (which will probably be never for the project I am working on)?



On Friday, March 15, 2019 at 9:27:41 PM UTC-4, Ahmed Ishtiaque wrote:
The character "*" represents "wildcard". Here is the real reason why the instructor puts it that way: <a href="https://docs.djangoproject.com/en/2.1/ref/settings/#email-backend" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F2.1%2Fref%2Fsettings%2F%23email-backend\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHv6BIe2LvC5Tb0JdDfWPe0zRNqyQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F2.1%2Fref%2Fsettings%2F%23email-backend\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHv6BIe2LvC5Tb0JdDfWPe0zRNqyQ&#39;;return true;">https://docs.djangoproject.com/en/2.1/ref/settings/#email-backend

There are a lot of variables that contain the 'EMAIL_' prefix, which is why the instructor wrote it that way.

On Fri, Mar 15, 2019 at 8:16 PM drone4four <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="rwIN0q1YBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">drone...@...> wrote:

If you take a look at this gist provided by a Udemy instructor and <a href="https://gist.github.com/bradtraversy/cfa565b879ff1458dba08f423cb01d71#local-settings-setup" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fbradtraversy%2Fcfa565b879ff1458dba08f423cb01d71%23local-settings-setup\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxYOvviOu5FfRg-UYMB-PYWUDlMQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fbradtraversy%2Fcfa565b879ff1458dba08f423cb01d71%23local-settings-setup\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxYOvviOu5FfRg-UYMB-PYWUDlMQ&#39;;return true;">at this specific location, here he wisely recommends separating important local development configuration parameters, such as SECRET _KEY. Of course everyone knows how stupid and foolish it would be to share the SECRET_KEY publicly on GitHub and then to use it in your production environment.


So here is the list of parameters to place in the separate remote settings.py as it appears in that gist linked to above:


  • SECRET_KEY

  • ALLOWED_HOSTS

  • DATABASES

  • DEBUG

  • EMAIL_*


If you look at the last one, it says: “EMAIL_*”. What do you people think the “_*” suffix? Is this standard for settings.py configurations? Or would you people think this is just a glaring typo on the side of the instructor?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="rwIN0q1YBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="rwIN0q1YBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2d0fca8e-3750-4fd0-8b36-5383b29e3191%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Separating remote vs local settings.py parameters - - “EMAIL”?

aishtiaque
If you don't need to send e-mail to your users then it's best not to specify any of the EMAIL_* settings. You can change the backend you use to send email with using EMAIL_BACKEND variable. This can be useful when you're tring to test your email format and such while developing your app. The django.core.mail.smtp.EmailBackend, as far as I remember, sends emails to your development server terminal so you can take a look at a text rendering of the email you're trying to test. If you want to hook up an external e-mail service for  your users in deployment, you can use email services like SendGrid, Mailchimp, etc. and these services use SMTP servers to send e-mails. Django lets you configure these as well. This tutorial helped me understand how sending e-mail to users in deployment works: https://simpleisbetterthancomplex.com/tutorial/2016/06/13/how-to-send-email.html
Since it makes use of an external mail service, you might find it helpful to understand the EMAIL_* variables.

But again, if you don't need to programmatically send e-mails to your users, don't bother specifying these settings. 

On Saturday, March 16, 2019 at 7:12:37 AM UTC-4, drone4four wrote:

So the remote server production email contact information could be different from the developer’s testcase email contact info?


I’ve taken a closer look at the “email-backend” section of the Django docs that you’ve linked to, Ahmed. I see Django supports email settings.  I don’t really understand what these EMAIL parameters would be used for. For example, EMAIL_BACKEND says:


Default: '<a href="https://docs.djangoproject.com/en/2.1/topics/email/#django.core.mail.backends.smtp.EmailBackend" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F2.1%2Ftopics%2Femail%2F%23django.core.mail.backends.smtp.EmailBackend\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE1xV9eTPBAiz7ZnxTgctn0d0KKmQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F2.1%2Ftopics%2Femail%2F%23django.core.mail.backends.smtp.EmailBackend\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE1xV9eTPBAiz7ZnxTgctn0d0KKmQ&#39;;return true;">django.core.mail.backends.smtp.EmailBackend'
The backend to use for sending emails. For the list of available backends see <a href="https://docs.djangoproject.com/en/2.1/topics/email/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F2.1%2Ftopics%2Femail%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEghTjNfVhLgn8urj6BhzgDsAUflQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F2.1%2Ftopics%2Femail%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEghTjNfVhLgn8urj6BhzgDsAUflQ&#39;;return true;">Sending email.

I followed these two links and it is still not clear to me: Are these email settings only used if I implement SMTP or other email services?


Would it be OK for me to just exclude altogether “EMAIL_*” until I reach a point when there is a need for an SMTP server (which will probably be never for the project I am working on)?



On Friday, March 15, 2019 at 9:27:41 PM UTC-4, Ahmed Ishtiaque wrote:
The character "*" represents "wildcard". Here is the real reason why the instructor puts it that way: <a href="https://docs.djangoproject.com/en/2.1/ref/settings/#email-backend" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F2.1%2Fref%2Fsettings%2F%23email-backend\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHv6BIe2LvC5Tb0JdDfWPe0zRNqyQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdocs.djangoproject.com%2Fen%2F2.1%2Fref%2Fsettings%2F%23email-backend\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHv6BIe2LvC5Tb0JdDfWPe0zRNqyQ&#39;;return true;">https://docs.djangoproject.com/en/2.1/ref/settings/#email-backend

There are a lot of variables that contain the 'EMAIL_' prefix, which is why the instructor wrote it that way.

On Fri, Mar 15, 2019 at 8:16 PM drone4four <[hidden email]> wrote:

If you take a look at this gist provided by a Udemy instructor and <a href="https://gist.github.com/bradtraversy/cfa565b879ff1458dba08f423cb01d71#local-settings-setup" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fbradtraversy%2Fcfa565b879ff1458dba08f423cb01d71%23local-settings-setup\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxYOvviOu5FfRg-UYMB-PYWUDlMQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fbradtraversy%2Fcfa565b879ff1458dba08f423cb01d71%23local-settings-setup\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGxYOvviOu5FfRg-UYMB-PYWUDlMQ&#39;;return true;">at this specific location, here he wisely recommends separating important local development configuration parameters, such as SECRET _KEY. Of course everyone knows how stupid and foolish it would be to share the SECRET_KEY publicly on GitHub and then to use it in your production environment.


So here is the list of parameters to place in the separate remote settings.py as it appears in that gist linked to above:


  • SECRET_KEY

  • ALLOWED_HOSTS

  • DATABASES

  • DEBUG

  • EMAIL_*


If you look at the last one, it says: “EMAIL_*”. What do you people think the “_*” suffix? Is this standard for settings.py configurations? Or would you people think this is just a glaring typo on the side of the instructor?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to [hidden email].
Visit this group at <a href="https://groups.google.com/group/django-users" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5c206304-7226-47df-a754-76602da2f417%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Separating remote vs local settings.py parameters - - “EMAIL”?

James Otombolo
In reply to this post by drone4four
If you take a look at this gist provided by a Udemy instructor and at this specific location, here he wisely recommends separating important local development configuration parameters, such as SECRET _KEY. Of course everyone knows how stupid and foolish it would be to share the SECRET_KEY publicly on GitHub and then to use it in your production environment.

On Sat, Mar 16, 2019, 3:15 AM drone4four <[hidden email]> wrote:

If you take a look at this gist provided by a Udemy instructor and at this specific location, here he wisely recommends separating important local development configuration parameters, such as SECRET _KEY. Of course everyone knows how stupid and foolish it would be to share the SECRET_KEY publicly on GitHub and then to use it in your production environment.


So here is the list of parameters to place in the separate remote settings.py as it appears in that gist linked to above:


  • SECRET_KEY

  • ALLOWED_HOSTS

  • DATABASES

  • DEBUG

  • EMAIL_*


If you look at the last one, it says: “EMAIL_*”. What do you people think the “_*” suffix? Is this standard for settings.py configurations? Or would you people think this is just a glaring typo on the side of the instructor?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fa499e85-b7cd-43a1-b21a-e8d6c665e498%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOz9w2G6suWzNradmmKoYbqLuhjkqHZyp9B999sWhSZQFLBrbA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.