How to call django DEBUG on a production server, not intrusively

I am looking for a safe DEBUG startup method for INTERNAL_IPS requests on a django production server without requiring changing the settings.py file. Basically, for the toolbar to gather for some designers to check problems with live data / media, but not relying on them to reset the settings after they are completed.

Like this method. hoverver is only suitable for deployment.

http://nicksergeant.com/blog/django/automatically-setting-debug-your-django-app-based-server-hostname

in the past on php systems I had mydomain.com and a demo file mydomaincom.myprodserver.com, where the prodserver domain can automatically run debugging code based on $ _SERVER ['HOST_NAME'], but django does not have a light superglobal, for example, in the example The hostname of the blog is / etc / hostname, not vhost.

Any ideas appreciated.

Edit:

I have a suitable solution (but ideally I would prefer a more portable one) by adding the path / path / to / django_in_debug / to sys.path from the entry myhostaincom.myprodserver.com vhost. Then in settings.py

try:
    from django_in_debug.settings import *
except:
    DEBUG = False
+5
source share
1 answer

, , , . INTERNAL_IPS, . settings.py, .

, settings.py, , , , , . Per Django , , , - - ( , , Django).

:

2 WSGI. WSGI settings.py, apache www.yourdomain.com . WSGI debug_settings.py, apache debug.yourdomain.com . debug_settinsg.py :

from settings import *

DEBUG = True
TEMPLATE_DEBUG = DEBUG

, . IP- . INTERNAL_IPS, , debug.yourdomain.com.

1 , .

+9

All Articles