Re: Debugging Django with Debug set to False

2016-01-06 Thread Dheerendra Rathor
What I do is to log things in log files. All exceptions are logged in
error.log files and I've enabled admin mail which sends me an email
whenever there is an exception.
So basically logs and emails are quite helpful in debugging and makes it
smooth.

On Wed, 6 Jan 2016 at 10:20 Web Architect  wrote:

> Thanks all for the responses and I would certainly consider them for
> production level debugging. I understand that application level debugging
> could be achieved by various logging mechanisms or tools.
>
> But one of my main concern is the platform level debugging where in if
> anything goes wrong with any package. For example, recently when I had set
> DEBUG=False, the backend was throwing HTTP 500. I was completely clueless
> what was happening. After deep debugging in the code, I figured out that
> 'compress js' that was being used in templates - it seemed was not being
> supported when DEBUG=False. It took some time to figure this out. Had there
> been a log or some mechanism, debugging would have been lot easier and
> quicker.
>
> On Monday, January 4, 2016 at 11:03:26 PM UTC+5:30, Web Architect wrote:
>>
>> Hi,
>>
>> Is there a way to debug Django when DEBUG is set to False in settings.py
>> (for example on production)?
>>
>> The reason for asking the above is if we face any issue with DEBUG set to
>> False and if we need to debug.
>>
>> We are new to Django and we are building an ecommerce platform based on
>> Django.
>>
>> Would appreciate if anyone could help with the above?
>>
>> Thanks.
>>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1550f31d-bcf7-430a-849f-f219e5ba3077%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAByqUgi3XW5pYp8x7gcfqTc8avJ0NJ8Mj8JKVhizH20cUzW4MQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Debugging Django with Debug set to False

2016-01-05 Thread Web Architect
Thanks all for the responses and I would certainly consider them for 
production level debugging. I understand that application level debugging 
could be achieved by various logging mechanisms or tools.

But one of my main concern is the platform level debugging where in if 
anything goes wrong with any package. For example, recently when I had set 
DEBUG=False, the backend was throwing HTTP 500. I was completely clueless 
what was happening. After deep debugging in the code, I figured out that 
'compress js' that was being used in templates - it seemed was not being 
supported when DEBUG=False. It took some time to figure this out. Had there 
been a log or some mechanism, debugging would have been lot easier and 
quicker.

On Monday, January 4, 2016 at 11:03:26 PM UTC+5:30, Web Architect wrote:
>
> Hi,
>
> Is there a way to debug Django when DEBUG is set to False in settings.py 
> (for example on production)? 
>
> The reason for asking the above is if we face any issue with DEBUG set to 
> False and if we need to debug. 
>
> We are new to Django and we are building an ecommerce platform based on 
> Django. 
>
> Would appreciate if anyone could help with the above?
>
> Thanks.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1550f31d-bcf7-430a-849f-f219e5ba3077%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Debugging Django with Debug set to False

2016-01-05 Thread Remco Gerlich
If it is the exception tracebacks you are after, consider setting up a
Sentry ( https://getsentry.com/ ) server to send the error / exception logs
of all your sites to. Whenever something bad happens, it'll show up there,
with full tracebacks.

Greetings,
Remco Gerlich

On Mon, Jan 4, 2016 at 6:33 PM, Web Architect  wrote:

> Hi,
>
> Is there a way to debug Django when DEBUG is set to False in settings.py
> (for example on production)?
>
> The reason for asking the above is if we face any issue with DEBUG set to
> False and if we need to debug.
>
> We are new to Django and we are building an ecommerce platform based on
> Django.
>
> Would appreciate if anyone could help with the above?
>
> Thanks.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c4f16aba-f0e0-4aae-a6c0-1513571c7a97%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFAGLK0c2qZbAwdtHhWL5SNe6ag-bD%2BizDBxbm4PK6FmcMtxRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Debugging Django with Debug set to False

2016-01-05 Thread Abraham Varricatt
Technically speaking, setting DEBUG=False on a production system does not 
render it un-debuggable. You can still debug and work with such deployments 
but expect resistance. An ancient approach to debugging ANY production 
environment is to liberally sprinkle printf (or the django log equivalent) 
everywhere in your code base. This has its drawbacks, but you could always 
push out a temporary patch to production to investigate something and 
revert afterwards.

Note: I do not recommend this approach. Always try to replicate issues in a 
development environment. Production meddling should only be a last resort 
and is usually an indication of a problem external to django anyways.

-Abraham V.


On Monday, 4 January 2016 23:03:26 UTC+5:30, Web Architect wrote:
>
> Hi,
>
> Is there a way to debug Django when DEBUG is set to False in settings.py 
> (for example on production)? 
>
> The reason for asking the above is if we face any issue with DEBUG set to 
> False and if we need to debug. 
>
> We are new to Django and we are building an ecommerce platform based on 
> Django. 
>
> Would appreciate if anyone could help with the above?
>
> Thanks.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/532d2ae4-6e38-46a7-9d5e-f17f0f77161a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Debugging Django with Debug set to False

2016-01-04 Thread Bill Freeman
You don't say what your front end is.  There are ways to use pdb with
apache, look for advise on the modwsgi site.

But if you are in production, rather than just bringing up the instance
that will be production, you may not want to interrupt.

Be sure that you can't reproduce the problem in the development server.
You can get debug turned off htere.

In the hard cases you need to increasing logging in the suspect code,
whether by use of Django's logging or by writing to a file with explicit
code.  Then you insert things in code that should have been reached, log
variables, including object attributes, that are interesting, and do a
binary search for the point where things differ from expectations.
(Actually, the first few logs, or even the planning of their placement,
will focus your attention sufficiently to see where the code doesn't meet
the design.)

On Mon, Jan 4, 2016 at 12:33 PM, Web Architect  wrote:

> Hi,
>
> Is there a way to debug Django when DEBUG is set to False in settings.py
> (for example on production)?
>
> The reason for asking the above is if we face any issue with DEBUG set to
> False and if we need to debug.
>
> We are new to Django and we are building an ecommerce platform based on
> Django.
>
> Would appreciate if anyone could help with the above?
>
> Thanks.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c4f16aba-f0e0-4aae-a6c0-1513571c7a97%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAB%2BAj0vHhTq8zS9Vxp-K_odieoYTh_wia0%2BV_mfCXd%3D%2B%3DnywqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Debugging Django with Debug set to False

2016-01-04 Thread Web Architect
Hi,

Is there a way to debug Django when DEBUG is set to False in settings.py 
(for example on production)? 

The reason for asking the above is if we face any issue with DEBUG set to 
False and if we need to debug. 

We are new to Django and we are building an ecommerce platform based on 
Django. 

Would appreciate if anyone could help with the above?

Thanks.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c4f16aba-f0e0-4aae-a6c0-1513571c7a97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.