- #1
fog37
- 1,569
- 108
Hello,
I want to learn about servers and deploying Python applications simply (without going to AWS, Azure, etc. but something a little more complicated than deploying my app to streamlit Cloud). I would like to get some recommendations given the multitude of options.
My goal is to create a personal website/blog that can be accessed by remote users who can run a simple Python regression model and get the prediction results in their browser. I believe these are the steps:
Summary
Request: Web client= Chrome ---> Web server=NginX (inside Digitaloptics VM) ------> WSGI=Gunicorn--Application server=Flask App ----> Database Server (MySQL)
Response: Web client=Chrome <--- Web server=Nginx<------WSGI=Gunicorn--Application server=Flask App<----Database Server (MySQL)
How does all this sound?
Thank you for your help!
I want to learn about servers and deploying Python applications simply (without going to AWS, Azure, etc. but something a little more complicated than deploying my app to streamlit Cloud). I would like to get some recommendations given the multitude of options.
My goal is to create a personal website/blog that can be accessed by remote users who can run a simple Python regression model and get the prediction results in their browser. I believe these are the steps:
- Develop a Flask app: create a Flask app that contains my simple scikit-learn regression model.
- Buy a Domain name from Domain Registrar: First I need to buy a domain name from an online domain registrar. What do you think about Google Domains?
- Web Server: I need to purchase a service that supports Python and WSGI. Some online options are Digitalocean, Heroku, PythonAnywhere... Which one would you recommend? For now, let's consider Digitalocean. I believe I will need to upload the web pages (i.e. the website) and the Flask app on Digitalocean...Digitalocean offers Droplets, which are virtual private servers (essentially virtual machines VM). The next steps involve choosing the web server itself. For example Nginx, which will be used as a reverse proxy to forward requests from web clients (browsers) to the WSGI server (ex: Gunicorn) to the Flask app (which plays the role of the application server) and deliver responses back to the clients. Nginx needs to be downloaded to the Droplet. Nginx, like all web servers, can only handle static files (html files, CSS files, images, JS files) without bothering the application server (Flask app). But if the web clients require dynamic content (Ex: predictions from the regression model), Nginx first accepts the HTTP request, forward it to WSGI (Gunicorn) which sends it to the Flask app (I guess Gunicorn, and any other WSGI, is not really a server but an interface...).
What about the website itself? What do you think is the most streamlined and easier (but not too easy) solution to create a website these day? I don't plan to creating html files, CSS sheets, JS files, etc. Do you recommend Wordpress? I guess I would then need to upload the Wordpress files to the Droplet. Some other components must be downloaded to work with the Wordpress files?
4. Database: Lastly, what if I wanted to also include in this education activity a database server? Which one would you recommend that is not too hard and not too easy to learn, setup, and can do the job? MySQL? SQlite? I will need to download such server on my Oceanoptics. The database server will talk directly to the application server (Flask app), correct?
Summary
Request: Web client= Chrome ---> Web server=NginX (inside Digitaloptics VM) ------> WSGI=Gunicorn--Application server=Flask App ----> Database Server (MySQL)
Response: Web client=Chrome <--- Web server=Nginx<------WSGI=Gunicorn--Application server=Flask App<----Database Server (MySQL)
How does all this sound?
Thank you for your help!