python - How do you debug unresponsive Django? -
i'm learning how deploy django site git. have development, staging , production environments. of them on laptop.
os , servers: ubuntu 14.04, gunicorn, nginx.
dev env in /webapps/mysite-dev/. staging env in /webapps/mysite-staging/. production env in /webapps/mysite-production/. have 3 separate users , directories above home directories users.
in development env site works absolutely fine. both django's development server , gunicorn.
from development environment: git push staging staging
post-receive hook makes migrations modifies environment-specific information in files.
then start development server python manage.py runserver
it starts ok. no errors.
then try load http://127.0.0.1:8000 home page of site not load , loading endless.
top shows python process eating 50% 80% of cpu.

i stop server ctrl+c, python process not go, have kill it. same happens when using gunicorn.
it looks infinite loop, have no idea bug be.
i tried putting pdb.set_trace() , simple return httpresponse("hello world") in first line of home page view. nothing. seems control of program not views @ all.
my question: how debug django when there no error messages neither in terminal nor in browser?
it looks development server not triggered browser. maybe try bind django development server specific port python manage.py runserver 0.0.0.0:8000 , try access site http://127.0.0.1:8000
Comments
Post a Comment