Forums

Flask Setup

I'm migrating a Flask app from another server and developer and he's not using flask_app.py, but another file, runserver.py, to start the app. The content of runserver.py is

:::python app = Flask(__name__)

:::python if __name__ == '__main__':
:::python db.metadata.create_all(db.engine)
:::python if 'liveconsole' not in gethostname():
:::python app.run()

and the ...wsgi.py file looks like:

:::python project_home = u'/home/DrDarin/hipcooks' if project_home not in
:::python sys.path:
:::python sys.path = [project_home] + sys.path

:::python from runserver import app as application

What am I missing to get this thing running? All I get is a "Coming Soon" page.

Did you work it out? I can see two websites associated with your account, both password protected -- no "coming soon" page. Or is that behind the password protection?

Nope, still struggling and the client is wondering...

I've also set up a cname entry with my registrar to point hipcooks.darinmolnar.com to the hipcooks Pythonanywhere site and it returns a 404.

I disabled password protection on the hipcooks site. Please have a look!

OK, I'm seeing an empty site there rather than a "coming soon" page. Can I look at your code? We can see it from our side, but we always ask for permission first.

I figured it out, thanks. It was a combination of a bad entry in settings.py (this is a VERY customized Flask implementation) and importing 'app' from the correct place and then replacing it with 'app=...'. I used a CodeMentor dude who helped me figure it out in 10 minutes.

Thank you for following up. Darin

Excellent, glad you worked it out! Did you hear about CodeMentor from the thing at the top of these forums, by the way? We're always interested in knowing if it's useful having that there.

Yes, that's where I got the idea. I was praying and praying and praying and there it was the entire time!

Please...keep it there.

Darin

Will do :-)