Hello Coders,
My (nick)name is Sm0ke and I'm using Flask for more than 5 years to code almost anything: simple one-page projects, API's and eComme...
For further actions, you may consider blocking this person and/or reporting abuse
Hello what is the simplest and cheapest way to deploy a flask site?
I am beginner and recently I had an opportunity to make a landing page for an architecture agency, and I saw that flask is very easy to use, but I am seeing that some shared hostings doesn't support python. What you suggest me to do, or do I have to change stack. Thank you.
Heroku has a free tier and is super easy to set up.
Another option is to buy a 5$ Droplet on DigitalOcean and use it for many projects.
Also, using a raw droplet, and make your own configuration in Apache/Nginx you will learn a lot.
Hello Sm0ke and Thanks for your time!
Can I use Flask embedded server for a production deploy?
I'm a beginner and configuring Apache/Nginx is not an easy job for me.
Hello,
Flask provides the embedded server mostly for development purposes. As mentioned on the official docs regarding the deployment, "Flask’s built-in server is not suitable for production".
Besides this warning, I see two major problems:
Even is not a simple task to configure a server, once you learn to do it, your application will be faster and secure.
Hi... thanks for your effort...
I was thinking of creating a folder in my flask project which is synchronized with my database... So that to speed up the speed...
Is this possible???
Hello,
Your pattern is quite original. Can you elaborate, please?
If you want to speed up things, not only in Flask, you have at least two options:
If you have the time, please access this guide related to Flask:
Your link is so rich of important information... I couldn't stop reading... Are you by any chance Smirnov???
Concerning speed, since querying a database takes time... I thought of creating a folder that does a query to the db only after each update for synchronization (mirror of db) ... So it should be acting similar to flatpages.
Smirnov??? .. who's this guy?
Between flatpages and DB pretty sure DB is faster and easier to locate the information.
On top of this, Redis is usually a solution to by-pass the DB queries.
Cheers!
smirnov-am.github.io/flask-perf/
this smirnov
Nope :)
Hi, a second question please...
Concerning security, does one have to depend on extensions to gain full security, or is Flask enough... I am asking this question because a developer can stop maintaining his extension and apps relying on it gets buggy.
Secure a web app is not an easy job but Flask helps a lot regarding this sensitive topic.
When your application uses a public module it might be a good idea to check a few relevant metrics:
Also, you can open a discussion on StackOverflow/Reddit and get answers from other coders with a similar concern.
Usually, I'm checking the new modules by following this short checklist.
P.S. If you are using Github, feel free to use Flask Tutorial to get answers related to Flask.
Cool idea. What are blueprints? When is recommended to use BP.
Ty!
Blueprints are basically modules, similar to
apps
in Django.Once a project is getting bigger, the files tend to become huge and not so easy to handle.
Using Blueprints, we can split the features using a modular structure. The official documentation is nicely written. Take a look and let me know if your thoughts.
is flask able to have endpoints closed/opened on command?
Can you elaborate, please?
if your Q address something like a dynamic routing based on the input, I think you can manage this in a controller and bypass the classic Flask routing:
Do you have/Can you recommend a repo for a docker(-compose) setup dev+prod ?
Hello,
I've built some starters in Flask, already Dockerized. For sure the repos are not the best on the
market
but can be used to have a good start:Both are tested and released under MIT License.
Thank you very much for this article and explanation.
Yw & Thanks for stopping by.