WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Discussion options

You must be logged in to vote

Most operating systems are now pre-configured to treat *.localhost as 127.0.0.1. So my strategy for using domains during local development is project.localhost, api.localhost, auth.api.localhost etc. If you use that, everything will already work.

Otherwise, the debugger is implemented as WSGI middleware. I'm not entirely sure how to add WSGI middleware to Django (as opposed to Django middelware), but it's definitely possible.

app = django.get_wsgi_app()  # something like this
debug_app = DebuggedApplication(app, evalex=True)
debug_app.trusted_hosts = [...]   # your own hosts here, or from django config
# somehow tell the django dev server to run this app instead

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jeromelefeuvre
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants