Django and Bad Request (400) -
i created new django project; added settings.py:
debug = false allowed_hosts= [ 'localhost', 'my_site.com' ]
created app test_view
; added hello_world
test_view.views
from django.http.response import httpresponse def hello_world(request): return httpresponse('hello world!!!')
added test route urls.py url(r'test/', 'test_view.views.hello_world')
; fixed /etc/hosts
127.0.0.1 localhost my_site.com
now when i'm trying access http://my_site.com:8000/test/
django returns bad request (400). when url http://localhost:8000/test/
can see hello world page. can wrong?
upd: same result debug = true
upd2:
one more working hostname ubuntu-virtualbox
(computer's name). when changed computer's name my_site
, ubuntu-virtualbox still available , my_site returned bad request (400)
may because of system settings? (it's clean ubuntu in virtualbox). or maybe problem in virtualenv? there way trace error?
it might bad cookie. try deleting them.
Comments
Post a Comment