简体   繁体   中英

Access Django from outside

I installed Django on my Ubuntu Server 14 as a development tool.
I want to access Django outside my server by using the URL http://my_server_ip:82 on any computer.

So I ran the command python manage.py runserver 0.0.0.0:82.

But when I try to connect to http://my_server_ip:82 from another computer, it doesn't work..

I also :
- allowed port 82 by using ufw allow in 82 and ufw allow out 82.
- wrote ALLOWED_HOSTS = ['*'] in settings.py

I read many and many topics dealing with this problem but it finally worked in many cases. I tried everything but nothing seems to work..
Would you have any solutions ?

Thanks !

It's not a good idea to use the builtin Django webserver in a production setting. I would encourage you to check alternatives like Apache, Spawning, Gunigorn, Cherokee or so.

Please refer to the documentation http://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-address-port

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM