I have a Django App which I want to deploy on a Centos Linux server
having a global/public IP
which is assigned to a domain
and is secured with SSL
.
The System configuration is as:
centos-release-6-10.el6.centos.12.3.x86_64
Apache/2.2.15 (CentOS)
When I run the server using:
python manage.py runserver 0.0.0.0:8000
,
then it is only accessible from the browser by passing a local IP say
http://192.xxx.xx.xxx:8000/django_app/home
But I want to access it from the public/global IP, but it gives an error when I replace the local IP with Global/Public IP or domain assigned to the public IP as:
105.168.296.58 took too long to respond.
Try:
Checking the connection
Checking the proxy and the firewall
Running Windows Network Diagnostics
ERR_CONNECTION_TIMED_OUT
When I simply put this public IP in the browser as https://105.168.296.58
then it redirects the browser to the app/website say https://mywebsite.com/home
which is running at port 80 on Apache, and shows the assigned domain instead of IP, so IP is working fine.
in settings.py: all hosts are allowed as ALLOWED_HOSTS = ['*']
Methods tried are:
- by using
django-extensions
as:
python manage.py runserver_plus --cert certname 0.0.0.0:8000
- by using
django-sslserver
as:
python manage.py runsslserver 0.0.0.0:8000
The app runs from both of these methods only locally at http://192.xxx.xx.xxx:8000/django_app/home
, but None of them worked from a Public IP.
Kindly tell, How to deploy or configure this Django App to Run Outside the Local Network?