Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
A template for deploying a flask app to apache server.[NOT A QUESTION RATHER A SOLUTION]
Has anyone had a nightmare deploying a flask app to apache. I have created a template for flask app that has all the folders required including the css and js files for twitter bootstrap. I have also included a .wsgi file and a user guide for deployment. The template assumes all apache2 prerequisites have been installed.
I have not tried deploying to a mac environment so i cannot comment much about that. In terms of the Virtual host, its good to have separate virtual host for each app. You could try having many Virtual hosts within the same httpd.conf file. Once you restart the apache2 server you should be able to tell if the Virtual host sections are all fine, as if not, you will see errors. Yes you can deploy your Flask app and wsgi to its own folders long as your paths are all correct i.e your Virtual host path points to the correct Flask app. I have deployed multiple Flask Apps on one server with no issues. In terms of Virtual environment, i recommend you create a virtual environment for each app so resources dont conflict with other apps. In regards to the imports, app is the app.py file from the root of that folder. I would also keep all the lines of code in the wsgi file especially the line that activates the virtual enviroment. I have made amends to my template on github so you might want to have a look at it again.
hope that helps you