Flange does not work in Virtualenv setup

Setup

VirtualBox | Ubuntu Server 12.04.2
(flaskve) vks @UbSrVb: ~ / flaskve $ python --version
Python 2.7.3
Ifconfig
192.168.1.100 (the bridge interface with which I interact with VirtualBox)

The code I'm trying to run.

from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello World!' if __name__ == '__main__': app.run(host='192.168.1.100', port=8080, debug=True) 

When i do

 (flaskve) vks@UbSrVb :~/flaskve$ python start.py (flaskve) vks@UbSrVb :~/flaskve$ 

It does not start and does nothing, it simply returns to the command line. Although I run debug = True.
Then I created a new VirtualEnv and installed a bottle in it. When I tried to run helloworld, it shows the same behavior.
However, I then started the python shell on the same virtual server, imported the flacon modules and ran

 >>> from bottle import route, run >>> run(host='192.168.1.100', port=8081, debug=True) Bottle v0.11.6 server starting up (using WSGIRefServer())... Listening on http://192.168.1.100:8081/ Hit Ctrl-C to quit. 

What could be the problem here? Even debugging shows nothing.
The following link is the output of python -v start.py
http://paste.ubuntu.com/5713138/

+4
source share
1 answer

The first example uses Flask, not a bottle. Maybe you confuse your code snippets here? :)

0
source

Source: https://habr.com/ru/post/1483333/


All Articles