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 about this:

AFAIK, the settings.MANAGERS are similar in nature: They're the ones 
administering the site, being notified of 404s using the 
BrokenLinkEmailsMiddleware 
.
 
Are they *meant* to also get support mails, or what is their role exactly?

Is there an app, middleware or view decorator that will notify a group of 
ppl (either users in a group or a list of email addresses), when a certain 
status code / error occurs (e.g. 500, 400, 404) at certain views? I'd need 
the ability to customize the mail template to make sure that all 
information needed to act upon the issue is there.

Google search, searching the mailing list archives and the error-handling 
grid of Django-packages revealed nothing even close to what I am looking 
for.

Thank you for any pointers!

Cheers,
murat

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/22122da6-f5bb-47f0-99b7-2c674c39e2fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 about this:
>
> AFAIK, the settings.MANAGERS are similar in nature: They're the ones
> administering the site, being notified of 404s using the
> BrokenLinkEmailsMiddleware
> .
> Are they *meant* to also get support mails, or what is their role exactly?
>
> Is there an app, middleware or view decorator that will notify a group of
> ppl (either users in a group or a list of email addresses), when a certain
> status code / error occurs (e.g. 500, 400, 404) at certain views? I'd need
> the ability to customize the mail template to make sure that all
> information needed to act upon the issue is there.
>
> Google search, searching the mailing list archives and the error-handling
> grid of Django-packages revealed nothing even close to what I am looking
> for.
>
> Thank you for any pointers!
>
> Cheers,
> murat
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/22122da6-f5bb-47f0-99b7-2c674c39e2fd%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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFWa6t%2BMULAb6rqtPxqptsy0%3DGTZfUFeJ3BMxzOUHBDK1QMQng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 on the information you gave, it's not a hard task.

Best,
Gergely
On 30 Aug 2015 15:30, "Avraham Serour"  wrote:

> 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 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 about this:
>>
>> AFAIK, the settings.MANAGERS are similar in nature: They're the ones
>> administering the site, being notified of 404s using the
>> BrokenLinkEmailsMiddleware
>> .
>> Are they *meant* to also get support mails, or what is their role exactly?
>>
>> Is there an app, middleware or view decorator that will notify a group of
>> ppl (either users in a group or a list of email addresses), when a certain
>> status code / error occurs (e.g. 500, 400, 404) at certain views? I'd need
>> the ability to customize the mail template to make sure that all
>> information needed to act upon the issue is there.
>>
>> Google search, searching the mailing list archives and the error-handling
>> grid of Django-packages revealed nothing even close to what I am looking
>> for.
>>
>> Thank you for any pointers!
>>
>> Cheers,
>> murat
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/22122da6-f5bb-47f0-99b7-2c674c39e2fd%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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFWa6t%2BMULAb6rqtPxqptsy0%3DGTZfUFeJ3BMxzOUHBDK1QMQng%40mail.gmail.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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACczBULLeAhcv4G7ECNHjFDMqENyD7-69qH9k44kbtTE-XfWxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 display my blog post like

{% for post in posts %} {{ post.entry }} {% endfor %}

But the template does not process {{ MEDIA_URL }}. It just sees it as a 
string and prints it exactly as passed in.

How do I get the template to treat {{ }} in my entry as a variable? How can 
I get that value substituted? I have used a custom template filter in the 
past. But this has got to be a very common use case. It seems like there 
would be some built in django way to get this to work?

Thanks,
Dennis

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/60b7bdc9-f396-4ffd-b4ff-10a7dd5931c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 display my blog post like
>
> {% for post in posts %} {{ post.entry }} {% endfor %}
>
> But the template does not process {{ MEDIA_URL }}. It just sees it as a
> string and prints it exactly as passed in.
>
> How do I get the template to treat {{ }} in my entry as a variable? How
> can I get that value substituted? I have used a custom template filter in
> the past. But this has got to be a very common use case. It seems like
> there would be some built in django way to get this to work?
>
> Thanks,
> Dennis
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/60b7bdc9-f396-4ffd-b4ff-10a7dd5931c0%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*monoBOT*
Visite mi sitio(Visit my site): monobotsoft.es/blog/

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BxOsGDaVDWA_xeP%2BwBSdYE%2BeMH6NcZUoDRXA6fJ%2BzOhrwhCCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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.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 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 display my blog post like
>>
>> {% for post in posts %} {{ post.entry }} {% endfor %}
>>
>> But the template does not process {{ MEDIA_URL }}. It just sees it as a 
>> string and prints it exactly as passed in.
>>
>> How do I get the template to treat {{ }} in my entry as a variable? How 
>> can I get that value substituted? I have used a custom template filter in 
>> the past. But this has got to be a very common use case. It seems like 
>> there would be some built in django way to get this to work?
>>
>> Thanks,
>> Dennis
>>
>> -- 
>> 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 django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/60b7bdc9-f396-4ffd-b4ff-10a7dd5931c0%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> *monoBOT*
> Visite mi sitio(Visit my site): monobotsoft.es/blog/
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/99e5bce9-1537-4bd1-99b1-a2b6e14aa64b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 the result due to variable expansion

You could do this by building the template up programmatically, and then 
passing the output of that process to the appropriate render method. You could 
also (probably better) write a custom template tag that does the right thing.

--
-- Christophe Pettus
   x...@thebuild.com

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/524E4D09-5384-41BF-A43D-4C650944C53F%40thebuild.com.
For more options, visit https://groups.google.com/d/optout.


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, it moves on.  So, template language constructs 
> that "appear" in the result due to variable expansion.

As a note, this is a feature, not a bug: If template expansion iterated like 
that, it would be a serious security hole, since someone could drop template 
items ( {{ entry.delete }}, anyone?) into user-edited content.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7995C1A8-4DAB-4E59-B661-325D93A8E9AB%40thebuild.com.
For more options, visit https://groups.google.com/d/optout.


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 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 the result due to variable expansion. 
>
> As a note, this is a feature, not a bug: If template expansion iterated 
> like that, it would be a serious security hole, since someone could drop 
> template items ( {{ entry.delete }}, anyone?) into user-edited content.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bad2c6f3-cdf4-447d-87e1-9a50f439efd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 I be worried about when using a custom User 
model?

One thing I can think of is, some plugins/apps might require django's 
built-in User model to function properly.
Any other issues I should be aware of?

Thank you,

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/049a9bbd-a2c0-4aa8-a65c-8bda8849cba9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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't
bother. If you will have tons, you should go with custom users, although be
warned that changing the user model while the project is live is a real
PITA.

Best,
Gergely
On 31 Aug 2015 06:11, "a.esmail"  wrote:

> 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 I be worried about when using a custom User
> model?
>
> One thing I can think of is, some plugins/apps might require django's
> built-in User model to function properly.
> Any other issues I should be aware of?
>
> Thank you,
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/049a9bbd-a2c0-4aa8-a65c-8bda8849cba9%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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACczBUJk5uzWDJGgMZW%2B4oSbnyZZEX2zKoh3FTWgv7Peuc8iPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.