I have a server in django which return 500 Error Code to my POST request from my mobile android app.
When I access it in the browser it works fine..
I don't really know how to debug\see any error messages in PyCharm. all I see is this, in the console window:
System check identified no issues (0 silenced).
May 24, 2015 - 17:09:12
Django version 1.8.1, using settings 'RidesBackend.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CTRL-BREAK.
[24/May/2015 17:10:01]"POST /users/register HTTP/1.1" 500 66235
[24/May/2015 17:11:10]"POST /users/register HTTP/1.1" 500 66235
From what I read 500 is INTERNAL SERVER ERROR -
so the error is in the server side, but I can't possibly know what is is without seeing error messagess or something...
I guess my question is where can I see error messages/LogCat/anything that reports errors with description in Pycharm for a django project? or debug it somehow?*
Thanks a lot!
Related
I have problems with negrok, it does not raise my local django web server, a few days ago everything worked correctly but a normal day, without having touched anything, it stopped working.
Run the following:
python manage.py runserver
Everything works normally and correctly.
Now I execute the following, in order to raise the local django server:
./ngrok http 8000
ngrok runs correctly without any problem but when accessing the ngrok link, the page is loading and everything is blank and does not work ....
This appears in ngrok:
ngrok by #inconshreveable (Ctrl+C to quit)
Session Status online
Account Julio (Plan: Free)
Version 2.3.34
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://33822c5a.ngrok.io -> http://localhost:8000
Forwarding https://33822c5a.ngrok.io -> http://localhost:8000
Connections ttl opn rt1 rt5 p50 p90
2 0 0.03 0.01 0.20 0.21
HTTP Requests
-------------
GET / 400 Bad Request
GET / 400 Bad Request
And this appears in django:
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
September 25, 2019 - 17:23:19
Django version 2.2.2, using settings 'ibme_proyect.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Invalid HTTP_HOST header: '33822c5a.ngrok.io'. You may need to add '33822c5a.ngrok.io' to ALLOWED_HOSTS.
Bad Request: /
[25/Sep/2019 17:25:30] "GET / HTTP/1.1" 400 68119
Invalid HTTP_HOST header: '33822c5a.ngrok.io'. You may need to add '33822c5a.ngrok.io' to ALLOWED_HOSTS.
Bad Request: /
[25/Sep/2019 17:25:38] "GET / HTTP/1.1" 400 68254
I add the ngrok host (33822c5a.ngrok.io) in ALLOWED_HOSTS and stop giving django error, and access the ngrok link and I know that it loads again, it doesn't load the HTML, nothing, everything blank ...
Any solution? :(
try
ALLOWED_HOSTS = ["*"]
this will allow tunneling every ngrok run :)
I've created a Django project and a virtual environment where I installed python on my Ubuntu server. When I try to run the development server by typing
$ ./manage.py runserver 0.0.0.0:8000
I get the usual
Performing system checks...
System check identified no issues (0 silenced).
April 01, 2017 - 11:36:55
Django version 1.10.6, using settings 'myproject.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
However, when I go to the site [my ip address]:8000 I get a 'This site can’t be reached' message, anyone know any causes for this? thanks
It was a security group problem in the server, I didn't have custom TCP rule 8000 enabled
I've recently installed django on Windows Server 2012 R2.
When I run python manage.py runserver it tell mes to use http://127.0.0.1:8000/ . Its working on Internet explorer but in Firefox and Chrome I get the following error.
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: http://127.0.0.1:8000/
Connection to 127.0.0.1 failed.
The system returned: (111) Connection refused
The remote host or network may be down. Please try the request again.
Your cache administrator is administrator.
Bypass proxy wasn't enabled. It worked after enabling.
I'm hosting on hostgator and using fcgi for my django app, its a sharedhost so I dont have much choice about flup and fcgi. When Debug = False I get a fcgi Unhandled Exception page instead of a Apache 404 error even though with Debug = True I would be getting a 404 from django/python.
Do I have to catch the python 404 exceptions in the fcgi file or should they just bubble up to Apache?
404 produces 500 Internal server error if your DEBUG is False and you do not have templates for 404. Make sure that you have 404.html and 500.html in your templates directory. Also have a look error logs in your admin email.
1)I am unable to access the website hosted by django's development server on my local machine(http://127.0.0.1:8000/).
2)I am unable to get the website in the browser.
Using Windows 7
When you start the server, it should say something like:
Validating models...
0 errors found
Django version 1.3, using settings 'myapp.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Do you get this message, and is the port number the same as the one you're using?
If it is, you could possibly have a problem with proxy settings. Does your browser have a proxy server configured?