Help with setting up a Flask application.
5 posts
• Page 1 of 1
- krunarsson
- Posts: 3
- Joined: 07 Feb 2014, 19:39
Help with setting up a Flask application.
Ok, for test I have basic flask application like given on the flask page named main.py in the folder myproject. Here is my code:
Then I install the Helicon Zoo Python Hosting project template and put it into folder named flask under wwwroot on my IIS.
What do I have to do to be able to run this application on the IIS? I have tried to set
And set PYTHONPATH to:
But when I run my page I always get error page.
Can someone please help me get this app to run on my IIS? I am not experienced with this server config stuff
Should I make separated wsgi.py file? What would it include and how would I connect it to my views í main.py?
- Code: Select all
from flask import Flask
application = app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
Then I install the Helicon Zoo Python Hosting project template and put it into folder named flask under wwwroot on my IIS.
What do I have to do to be able to run this application on the IIS? I have tried to set
<!-- generic wsgi app -->
<add name="WSGI_APP" value="main.application" />
And set PYTHONPATH to:
<add name="PYTHONPATH" value="%APPL_PHYSICAL_PATH%\venv\lib\site-packages;%APPL_PHYSICAL_PATH%\venv\lib;%APPL_PHYSICAL_PATH%;%APPL_PHYSICAL_PATH%C:\inetpub\wwwroot\flask\myproject;" />
But when I run my page I always get error page.
- Code: Select all
500 Error
Helicon Zoo module has caught up an error. Please see the details below.
Worker Status
The process was created
Windows error
The pipe has been ended. (ERROR CODE: 109)
Internal module error
message: ZooApplication backend read Error. type: ZooException file: Jobs\JobBase.cpp line: 566 version: 3.1.98.508
STDERR
Empty stderr
Can someone please help me get this app to run on my IIS? I am not experienced with this server config stuff
Should I make separated wsgi.py file? What would it include and how would I connect it to my views í main.py?
Re: Help with setting up a Flask application.
Hello!
I have ran this example flask app on IIS Express with following steps:
1. Install Python project template (New IIS Express web site will be created).
2. Open web console in <you app url>/console (see right link at welcome page) and run 'pip install flask' to install flask in local virtualenv.
3. Place main.py to app root (near web.config).
4. Update web.config:
update to
Full web.config: https://gist.github.com/rukeba/8914074
That`s all, refresh app page in browser.
Note that if you install template in IIS (not IIS Express) not into the site root but into some folder, e.g. myproject, remember:
1. this folder must be a module, i.e. must contain a __init__.py file and you WSGI_APP will be 'myproject.main.application',
2. URLs in your Flask app should account for this: @app.route("/myproject/")
Thanks!
I have ran this example flask app on IIS Express with following steps:
1. Install Python project template (New IIS Express web site will be created).
2. Open web console in <you app url>/console (see right link at welcome page) and run 'pip install flask' to install flask in local virtualenv.
3. Place main.py to app root (near web.config).
4. Update web.config:
- Code: Select all
<add name="WSGI_APP" value="welcome.application" />
update to
- Code: Select all
<add name="WSGI_APP" value="main.application" />
Full web.config: https://gist.github.com/rukeba/8914074
That`s all, refresh app page in browser.
Note that if you install template in IIS (not IIS Express) not into the site root but into some folder, e.g. myproject, remember:
1. this folder must be a module, i.e. must contain a __init__.py file and you WSGI_APP will be 'myproject.main.application',
2. URLs in your Flask app should account for this: @app.route("/myproject/")
Thanks!
- krunarsson
- Posts: 3
- Joined: 07 Feb 2014, 19:39
Re: Help with setting up a Flask application.
Thank you! It is running now!
Re: Help with setting up a Flask application.
It is the way to get the gta 5 money generator for the cheats and hack for the gta 5 game and it is proving to be useful.
Re: Help with setting up a Flask application.
<a title="link building service" href="http://www.hstecsol.com/seo.html">link building service</a>
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest