Hello, Surely this question is newbiet, but i don't know how to run Flask. I have installed Flask in my venv (virtual env) but i don't know if Flask has his own webserver or not. I mean, when i access http://flask.pocoo.org/docs/quickstart/#quickstart i can see " Just save it as hello.py (or something similar) and run it with your Python interpreter. Make sure to not call your application flask.py because this would conflict with Flask itself. $ python hello.py * Running on http://127.0.0.1:5000/" Where do I need to create this hello.py? And what about the server? (http://127.0.0.1:5000) Thanks -- *Mauricio de Abreu Antunes* Mobile: (51)930-74-525 Skype: mauricio.abreua
Hi Mauricio, You can save your hello.py anywhere you want (but i suggest creating a folder specifically for this app) and then just run it with 'python hello.py' as you would with any python script. By running 'python hello.py' flask effectively creates it's own web server and starts serving the app at http://127.0.0.1:5000/ Hope that helps, Matt -- Matthew Brown Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, 31 October 2012 at 10:42 AM, Mauricio de Abreu Antunes wrote: > Hello, > > Surely this question is newbiet, but i don't know how to run Flask. > I have installed Flask in my venv (virtual env) but i don't know if Flask has his own webserver or not. I mean, when i access http://flask.pocoo.org/docs/quickstart/#quickstart i can see > " > Just save it as hello.py (or something similar) and run it with your Python interpreter. Make sure to not call your application flask.py because this would conflict with Flask itself. > $ python hello.py * Running on http://127.0.0.1:5000/" > > Where do I need to create this hello.py? > And what about the server? (http://127.0.0.1:5000) > > Thanks > > -- > Mauricio de Abreu Antunes > Mobile: (51)930-74-525 > Skype: mauricio.abreua >
Hello, If my questions are newbies, please, tell me. So i need to create a python script in my virtual environment (this is a specific app folder named ETLWeb) and i can access it at 127.0.0.1:5000, right? How does Flask recognizes the mapping of files? Is it like Apache? (alias mapping folders in htdocs). 2012/10/30 Matthew Brown <mnbbrown@gmail.com> > Hi Mauricio, > > You can save your hello.py anywhere you want (but i suggest creating a > folder specifically for this app) and then just run it with 'python > hello.py' as you would with any python script. > By running 'python hello.py' flask effectively creates it's own web server > and starts serving the app at http://127.0.0.1:5000/ > > Hope that helps, > Matt > > -- > Matthew Brown > Sent with Sparrow <http://www.sparrowmailapp.com/?sig> > > On Wednesday, 31 October 2012 at 10:42 AM, Mauricio de Abreu Antunes > wrote: > > Hello, > > Surely this question is newbiet, but i don't know how to run Flask. > I have installed Flask in my venv (virtual env) but i don't know if Flask > has his own webserver or not. I mean, when i access > http://flask.pocoo.org/docs/quickstart/#quickstart i can see > " > > Just save it as hello.py (or something similar) and run it with your > Python interpreter. Make sure to not call your application flask.pybecause this would conflict with Flask itself. > > $ python hello.py > * Running on http://127.0.0.1:5000/" > > Where do I need to create this hello.py? > And what about the server? (http://127.0.0.1:5000) > > > > Thanks > > > -- > *Mauricio de Abreu Antunes* > Mobile: (51)930-74-525 > Skype: mauricio.abreua > > > -- *Mauricio de Abreu Antunes* Mobile: (51)930-74-525 Skype: mauricio.abreua
Mauricio, Flask is not a webserver in the sense of apache - it can serve static files from a special `static` directory that is usually put at the application root. The Jinja template environment provides a way to generate frontend markup. What you will actually be working with are endpoints created with the @route decorator. The Flask tutorial is really very detailed about how to put your logic to be activated at a specific url endpoint. On Tue, Oct 30, 2012 at 9:16 PM, Mauricio de Abreu Antunes < mauricio.abreua@gmail.com> wrote: > Hello, > > If my questions are newbies, please, tell me. > So i need to create a python script in my virtual environment (this is a > specific app folder named ETLWeb) and i can access it at 127.0.0.1:5000, > right? > How does Flask recognizes the mapping of files? > Is it like Apache? (alias mapping folders in htdocs). > > > 2012/10/30 Matthew Brown <mnbbrown@gmail.com> > >> Hi Mauricio, >> >> You can save your hello.py anywhere you want (but i suggest creating a >> folder specifically for this app) and then just run it with 'python >> hello.py' as you would with any python script. >> By running 'python hello.py' flask effectively creates it's own web >> server and starts serving the app at http://127.0.0.1:5000/ >> >> Hope that helps, >> Matt >> >> -- >> Matthew Brown >> Sent with Sparrow <http://www.sparrowmailapp.com/?sig> >> >> On Wednesday, 31 October 2012 at 10:42 AM, Mauricio de Abreu Antunes >> wrote: >> >> Hello, >> >> Surely this question is newbiet, but i don't know how to run Flask. >> I have installed Flask in my venv (virtual env) but i don't know if Flask >> has his own webserver or not. I mean, when i access >> http://flask.pocoo.org/docs/quickstart/#quickstart i can see >> " >> >> Just save it as hello.py (or something similar) and run it with your >> Python interpreter. Make sure to not call your application flask.pybecause this would conflict with Flask itself. >> >> $ python hello.py >> * Running on http://127.0.0.1:5000/" >> >> Where do I need to create this hello.py? >> And what about the server? (http://127.0.0.1:5000) >> >> >> >> >> Thanks >> >> >> -- >> *Mauricio de Abreu Antunes* >> Mobile: (51)930-74-525 >> Skype: mauricio.abreua >> >> >> > > > -- > *Mauricio de Abreu Antunes* > Mobile: (51)930-74-525 > Skype: mauricio.abreua > >
*...it can serve static files from a special `static` directory that is usually put at the application root.* * * Now i got the point, thanks. 2012/10/30 Mark Grey <mark.asperia@gmail.com> > Mauricio, > > Flask is not a webserver in the sense of apache - it can serve static > files from a special `static` directory that is usually put at the > application root. The Jinja template environment provides a way to > generate frontend markup. > > What you will actually be working with are endpoints created with the > @route decorator. The Flask tutorial is really very detailed about how to > put your logic to be activated at a specific url endpoint. > > > On Tue, Oct 30, 2012 at 9:16 PM, Mauricio de Abreu Antunes < > mauricio.abreua@gmail.com> wrote: > >> Hello, >> >> If my questions are newbies, please, tell me. >> So i need to create a python script in my virtual environment (this is a >> specific app folder named ETLWeb) and i can access it at 127.0.0.1:5000, >> right? >> How does Flask recognizes the mapping of files? >> Is it like Apache? (alias mapping folders in htdocs). >> >> >> 2012/10/30 Matthew Brown <mnbbrown@gmail.com> >> >>> Hi Mauricio, >>> >>> You can save your hello.py anywhere you want (but i suggest creating a >>> folder specifically for this app) and then just run it with 'python >>> hello.py' as you would with any python script. >>> By running 'python hello.py' flask effectively creates it's own web >>> server and starts serving the app at http://127.0.0.1:5000/ >>> >>> Hope that helps, >>> Matt >>> >>> -- >>> Matthew Brown >>> Sent with Sparrow <http://www.sparrowmailapp.com/?sig> >>> >>> On Wednesday, 31 October 2012 at 10:42 AM, Mauricio de Abreu Antunes >>> wrote: >>> >>> Hello, >>> >>> Surely this question is newbiet, but i don't know how to run Flask. >>> I have installed Flask in my venv (virtual env) but i don't know if >>> Flask has his own webserver or not. I mean, when i access >>> http://flask.pocoo.org/docs/quickstart/#quickstart i can see >>> " >>> >>> Just save it as hello.py (or something similar) and run it with your >>> Python interpreter. Make sure to not call your application flask.pybecause this would conflict with Flask itself. >>> >>> $ python hello.py >>> * Running on http://127.0.0.1:5000/" >>> >>> Where do I need to create this hello.py? >>> And what about the server? (http://127.0.0.1:5000) >>> >>> >>> >>> >>> >>> >>> Thanks >>> >>> >>> -- >>> *Mauricio de Abreu Antunes* >>> Mobile: (51)930-74-525 >>> Skype: mauricio.abreua >>> >>> >>> >> >> >> -- >> *Mauricio de Abreu Antunes* >> Mobile: (51)930-74-525 >> Skype: mauricio.abreua >> >> > -- *Mauricio de Abreu Antunes* Mobile: (51)930-74-525 Skype: mauricio.abreua