How do you deploy a hybrid system , saying that mixing WordPress CMS with Flask applications, in one domain ?
Yes. I am using Hybrid architect for the domain. You may ask why I should do with this complex ? My answer is quite simple, to make things done easily. See Flask app demo.
How is that ? Imaging that you are running CMS, like blogs, and eCommerce with WooCommerce. The best solution is to deploy these systems in WordPress. See ! it is just a piece of cakes if you know WordPress well.
But what if adding a Flask application to the architect? It is a common practice if you wanna run a customized application for your own. The limitation is you have only one domain.
Yes. You have only one domain to run multiple applications. Is it possible? Let me show my designed architect.
In the figure above, users could access your systems through a single web server, built on Apache. However, there are 3 applications behind the scenes. One is a blog , eCommerce is another, and Flask app goes next.
The blog and the eCommerce sites are built on WordPress, which is not difficult at all. For demo purpose, Flask app is simple one as well. In the long run, I will build a Stock analysis site to replace this simple Flask app.
All these applications will all connect to MySQL server. Flask app utilize WSGI to work with Apache web server.
Summarize the advantages of Hybrid system:
- You could install all of your applications in one domain to enrich your sites and save your money. Take this site for example, comhawk.com, based on WordPress, we could easily build one blog site and one eCommerce site. Meanwhile, we could also build Flask applications for complex systems, like data analysis and stock analysis.
- Apache supports the function of https (SSL). One setting for all applications, which saves a lot efforts.
- Apache is the only one which control the all the applications. Through it, you could start applications up or shut them down all together. Not necessary for you to configure Flask Applications as services one by one.
In the following post, I will give you briefing how to do this configuration.