over-ride the IP address in development.ini

25 views
Skip to first unread message

herb

unread,
Sep 11, 2010, 8:46:35 AM9/11/10
to TurboGears
I am building an appliance that includes a TG2.0 application.The
appliance user can change the IP address of the appliance, but
development.ini specifies the host. If I use localhost, it cannot be
accessed by other machines on my network. Is there a way to over-ride
this IP address when invoking the application with paster or is there
a way to make this more dynamic? Am I stuck with editing the .ini
file each time the IP changes?

Thanks,
Herb

Timuçin Kızılay

unread,
Sep 11, 2010, 9:16:15 AM9/11/10
to turbo...@googlegroups.com

I'm using ip address of 0.0.0.0 in development ini. this 0.0.0.0 meand
listen on all ip addresses on the machine.

herb

unread,
Sep 12, 2010, 9:05:24 AM9/12/10
to TurboGears
Thanks, Timuçin, your response led me to some interesting education,
but it does not really solve my problem. I need to set the appliance
to some address; there may be multiple appliances on the same server;
and they will each require their own IP address. Really what I am
asking is whether there is a way to override the IP address assigned
in development.ini at run time or do I need to edit development.ini
(or production.ini)? For example, I would really like to be able to
use something like:

paster serve --ip=192.168.97.33 production.ini

in my init.d script.

My appliance needs to be accessible from outside the server on which
it is being run as a virtual machine, but still only within the
firewall (not the public network (that's why I can use the 192.168
kind of private address).
I'm sorry that I was not more clear yesterday.

Thanks,
Herb

Diez B. Roggisch

unread,
Sep 12, 2010, 9:17:11 AM9/12/10
to turbo...@googlegroups.com

On Sep 12, 2010, at 3:05 PM, herb wrote:

> Thanks, Timuçin, your response led me to some interesting education,
> but it does not really solve my problem. I need to set the appliance
> to some address; there may be multiple appliances on the same server;
> and they will each require their own IP address. Really what I am
> asking is whether there is a way to override the IP address assigned
> in development.ini at run time or do I need to edit development.ini
> (or production.ini)? For example, I would really like to be able to
> use something like:
>
> paster serve --ip=192.168.97.33 production.ini
>
> in my init.d script.
>
> My appliance needs to be accessible from outside the server on which
> it is being run as a virtual machine, but still only within the
> firewall (not the public network (that's why I can use the 192.168
> kind of private address).
> I'm sorry that I was not more clear yesterday.


paster known key=value arguments to the command-line which can be replaced in the config. It explicitly mentions http-ports, so probably iPs work to.

(abl.formstream)tequila:framework deets$ paster help serve
Usage: /Users/deets/.virtualenvs2.5/abl.formstream/bin/paster serve [options] CONFIG_FILE [start|stop|restart|status] [var=value]
Serve the described application

This command serves a web application that uses a paste.deploy configuration
file for the server and application. If start/stop/restart is given, then
--daemon is implied, and it will start (normal operation), stop (--stop-
daemon), or do both. You can also include variable assignments like
'http_port=8080' and then use %(http_port)s in your config files.

Diez

herb

unread,
Sep 12, 2010, 1:35:45 PM9/12/10
to TurboGears
Thanks, Diez.

I will give it a try. That sounds like just what I was looking for.
Regards,
Herb
Reply all
Reply to author
Forward
0 new messages