views:

75

answers:

3

Hello, Experts

I've got a question. I'm currently trying out the Django framework and I would share/present/show some stuff I've made to my workmate/friends. I work in Ubuntu under Win7 via VMware. So my wish/desire is to send my current pub-IP with port (e.g http://123.123.123.123:8181/django-app/) to my friends so they could test it.

the Problem is - I use django's Dev server (python /path-to-django-app/manage.py runserver $IP:$PORT).

How do I make the devserver public ?

Suggestions?

P.S. Sorry for bad English

EDIT:

Oh, there's something i forgot to mention. As I sad I use VMware with Ubuntu. I have a shellscript that returns me my current int-IP 192.168.xx.xx an saves it in a environment-variable ($CUR_IP) So, each time I want to run django's devserver I simply execute

python /path-to-django-site/manage.py runserver $CUR_IP:8080

At this way I become an http-adress (e.g.http://192.168.40.145:8080/app-name/) which I CAN USE OUTSIDE my virtual machine. I could test it on my host (win7) machine. That's actually the reason why I asked the question. I thought there's a way to use the ext-IP and make runserver usabable outise too

+2  A: 
python manage.py runserver 0.0.0.0:8181

This will run development server that should listen on all IP's on port 8181, but it will still be single threaded so only one connection will be possible at the time.

From docs:

Note that the default IP address, 127.0.0.1, is not accessible from other machines on your network. To make your development server viewable to other machines on the network, use its own IP address (e.g. 192.168.2.1) or 0.0.0.0.

rebus
so, the only way to do this is congifiguring apache, mod_py, etc ? Simple - use 'normal' web-server (apache, lighttp, etc) instead django's DevServer ?
V-Light
I'd say it depends on number of developers, i work in small team and for showing off i do use development server, but if you have a need for many concurrent connections I'd suggest using real web server (we use [Apache and mod_wsgi](http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/), [mod_python](http://docs.djangoproject.com/en/dev/howto/deployment/modpython/?from=olddocs) is not maintained anymore.)
rebus
A: 

You need to configure bridged networking in VMWare and also grant access to the target port in Ubuntu firewall.

Homer
Way bridged? I use NAT-settings and I'm able to access this IP from outside (curently only HOST)Why(What for) should I configure ubuntu-firewall? Is it necessary to enable access from outside for other (non-host) machines ?
V-Light
A: 

192.168.*.* is a LAN-private address -- once you've done the proper VMWare (or other VM manager) and firewall incantations to make it accessible from the LAN, it still won't be accessible from outside the LAN, i.e., from the internet at large (a good thing too, because such development servers are not designed for security and scalability).

To make some port of a machine with a LAN-private IP visible to the internet at large, you need a router with a "virtual servers" ability (many routers, even cheap ones, offer it, but it's impossible to be specific about enabling it since each brand has its own idiosyncratic way). I would also recommend dyndns or other similar service to associate a stable DNS name to your always-varying public IP (unless you're splurging for a static IP from your connectivity provider, of course, but the latter option is becoming costlier all the time).

superuser.com or serverfault.com may provide better answers and details (once you give every single little detail of your configuration in a question) since the question has nothing much to do with software development and everything to do with server administration and configuration.

Alex Martelli