librelist archives

« back to archive

Localhost problem

Localhost problem

From:
Tomas Zulberti
Date:
2011-03-04 @ 15:21
Hi. I am using flask for a personal project, and have the following
issue: when accessing the url: localhost:5000 everything works ok. But
if I use mi ip (192.168.0.X) then it doesn't connect? I am sure that
is a configuration issue but I wasn't able to found in it in the
docuementation. I am starting the server in with the following code:

DEBUG = True
DEBUG_DATABASE = False
DATABASE_URL = "sqlite:///%s/database.db" % CURRENT_DIR

app = Flask('pywebuml')
app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URL
app.config['SQLALCHEMY_ECHO'] = DEBUG_DATABASE
app.debug = DEBUG
db = SQLAlchemy(app)

Thanks in advance,
Tomas Zulberti

Re: [flask] Localhost problem

From:
Stephane Wirtel
Date:
2011-03-04 @ 15:23
On 03/04/2011 04:21 PM, Tomas Zulberti wrote:
> Hi. I am using flask for a personal project, and have the following
> issue: when accessing the url: localhost:5000 everything works ok. But
> if I use mi ip (192.168.0.X) then it doesn't connect? I am sure that
> is a configuration issue but I wasn't able to found in it in the
> docuementation. I am starting the server in with the following code:
> 
> DEBUG = True
> DEBUG_DATABASE = False
> DATABASE_URL = "sqlite:///%s/database.db" % CURRENT_DIR
> 
> app = Flask('pywebuml')
> app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URL
> app.config['SQLALCHEMY_ECHO'] = DEBUG_DATABASE
> app.debug = DEBUG
> db = SQLAlchemy(app)
> 
> Thanks in advance,
> Tomas Zulberti
add the host in the run method.

app.run(host='0.0.0.0')

Re: [flask] Localhost problem

From:
Tomas Zulberti
Date:
2011-03-04 @ 15:25
On Fri, Mar 4, 2011 at 12:23 PM, Stephane Wirtel <stephane@wirtel.be> wrote:
> On 03/04/2011 04:21 PM, Tomas Zulberti wrote:
>> Hi. I am using flask for a personal project, and have the following
>> issue: when accessing the url: localhost:5000 everything works ok. But
>> if I use mi ip (192.168.0.X) then it doesn't connect? I am sure that
>> is a configuration issue but I wasn't able to found in it in the
>> docuementation. I am starting the server in with the following code:
>>
>> DEBUG = True
>> DEBUG_DATABASE = False
>> DATABASE_URL = "sqlite:///%s/database.db" % CURRENT_DIR
>>
>> app = Flask('pywebuml')
>> app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URL
>> app.config['SQLALCHEMY_ECHO'] = DEBUG_DATABASE
>> app.debug = DEBUG
>> db = SQLAlchemy(app)
>>
>> Thanks in advance,
>> Tomas Zulberti
> add the host in the run method.
>
> app.run(host='0.0.0.0')
>

Thanks, problem solved...