Notify Customer Support of Request Failures

2015-08-30 Thread murat . knecht
Hello, I'd like to notify our customer support of certain errors. For example, if a sign up fails (a 500, for whatever reason), I want them to get a mail with as much information as possible about the customers and their request, so they can contact them and resolve the issue. Two questions abo

Re: Notify Customer Support of Request Failures

2015-08-30 Thread Avraham Serour
add logging messages everywhere that matters, include any information relevant to you, then monitor the logs. the ELK stack is nice ( https://www.elastic.co/products/logstash) On Sun, Aug 30, 2015 at 7:49 AM, wrote: > Hello, > > I'd like to notify our customer support of certain errors. For exam

Re: Notify Customer Support of Request Failures

2015-08-30 Thread Gergely Polonkai
Hello, in a default Django installation the 500 responses are handled by the logger, not a middleware. It is possible to write a middleware that captures all error responses, and sends a mail about each of them (or only if they are relevant). I don't know of any that is already written, but based

Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Dennis Marwood
Hello, I have a seemingly straight forward and likely common issue. But there is no obvious way that I am seeing to make it work. I have a Blog model with a text field called entry. I want to put something like into the blog post. So Blog.entry would contain it. Then I use the template to

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread monoBOT
You can import your any part of your settings into the model.py file and then insert it like this: from django.conf import MEDIA_URL 2015-08-30 20:43 GMT+01:00 Dennis Marwood : > Hello, > > I have a seemingly straight forward and likely common issue. But there is > no obvious way that I am see

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Dennis Marwood
So you are saying I should alter the models save method to do a search and replace on the entry field? On Sunday, 30 August 2015 14:03:18 UTC-7, monoBOT monoBOT wrote: > > You can import your any part of your settings into the model.py file and > then insert it > > like this: > > from django.con

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Christophe Pettus
On Aug 30, 2015, at 12:43 PM, Dennis Marwood wrote: > How do I get the template to treat {{ }} in my entry as a variable? The Django template language doesn't iterate over the results of expansion; once a substitution is done, it moves on. So, template language constructs that "appear" in th

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Christophe Pettus
On Aug 30, 2015, at 2:37 PM, Christophe Pettus wrote: > On Aug 30, 2015, at 12:43 PM, Dennis Marwood wrote: > >> How do I get the template to treat {{ }} in my entry as a variable? > > The Django template language doesn't iterate over the results of expansion; > once a substitution is done,

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

2015-08-30 Thread Dennis Marwood
Ok, thanks. It seems like such a common use case that I wanted to be sure there was not an existing template tag for it. On Sunday, 30 August 2015 14:48:47 UTC-7, Christophe Pettus wrote: > > > On Aug 30, 2015, at 2:37 PM, Christophe Pettus > wrote: > > > On Aug 30, 2015, at 12:43 PM, Dennis M

What are the disadvantages of using a custom user model?

2015-08-30 Thread a.esmail
Hello, I am evaluating whether it is better to use a custom user model in django or just extend django.contrib.auth.models.User. The default User model offers a lot of the functionality that I don't need in my project and doesn't have a lot of fields that I will need. My question is, what should

Re: What are the disadvantages of using a custom user model?

2015-08-30 Thread Gergely Polonkai
Hello, is it the fields or the functionality you don't need? If it is really the functionality, you shouldn't bother; just don't use it. If some of the fields, then it worths an evaluation on why you don't need them, if you will have only a few users (e.g. a company internal app), then again, don'