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?
Related
My Django application run well for a while, then I got 502 Bad Gateway, after a few hours, I am unable to ping the domain and use SSH to connect my server(from Amazon Lightsail). My other application served by ngnix was also not available then. While if I didn't start the Django application, ther application served by ngnix would run steadily. So I guess it is the error of my Django application crashed ngnix and the server.
After rebooting the server for serveral times, the server seems recovered then I can ping the domain and use SSH to connect the server. But after a while, the same problem would occurs again. I wonder how to fix the problem.
Some diagnostic information since the start of the Django application to the end of the Nginx server provided below.
The RAM usage is high during the process.
The uwsgi log. https://bpa.st/FP7Q
The Nginx error log. https://bpa.st/35EQ
So I have set up my Django server through an SSH connection to my remote server. It shows me that the server is actually running:
August 10, 2020 - 04:09:47
Django version 3.1, using settings 'risk_areas.settings'
Starting development server at http://xx.xxx.xxx.xxx:8000/
Quit the server with CONTROL-C
However, if I try to go to the URL above (with my IP address in it) it gives me a connection time out error. What might be the reason for this?
django website is working fine on localhost but when hosted on server using nginx and gunicorn, some APIs are throwing 500 server error. This problem is with some APIs and rest of the APIs are working well. Please help me what should I do?
This is probably a very basic question. I SSH to my virtual Ubuntu server and start a django webserver running on localhost:
Downloading/unpacking django
Downloading Django-1.9.5-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: django
Successfully installed django
Cleaning up...
Performing system checks...
System check identified no issues (0 silenced).
You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
April 13, 2016 - 14:16:19
Django version 1.9.5, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
The Ubuntu server has a static IP [x.xxx.xxx.xxx] so from another machine on another network I try to access the above website in a browser using that static IP address:
x.xxx.xxx.xxx:8000
But I get:
This site can’t be reached
x.xxx.xxx.xxx refused to connect.
ERR_CONNECTION_REFUSED
So I assume that I cannot access the website like this and that is only available on the host it self even though the host has an external/static IP address?
Edit:
The answer is also in:
https://docs.djangoproject.com/en/1.9/intro/tutorial01/#the-development-server
python manage.py runserver 0.0.0.0:8000
You need to run your web server on 0.0.0.0:8000, then externally you would use either ip or host name to access. Using 0.0.0.0 means the django service would listen to all configured network interfaces.
Check wikipedia on details about 0.0.0.0.
Another answer on serverfault could be helpful.
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.