r/flask Nov 21 '24

Tutorials and Guides How I Escaped Python Dependency Hell with pip-tools

Thumbnail
medium.com
10 Upvotes

Key points:

  1. The Problem: Managing Python dependencies is messy and prone to conflicts.

  2. The Solution: Use pip-tools to simplify and streamline dependency management.

  3. How It Works: • pip-compile: Creates a clean, locked requirements.txt from a requirements.in file

    • pip-sync: Ensures your environment matches the requirements.txt

  4. Why It’s Great: Saves time, avoids conflicts, and keeps dependencies clean and consistent

r/flask Sep 15 '24

Tutorials and Guides Flask App Deployment

2 Upvotes

Hi, I have finished building a Flask app and have tried numerous deployment services (PythonAnywhere, Vercel, Render, etc.). I've even tried Google Cloud. My app uses AI and is using meta.ai for its AI features. Using meta.ai makes API calls to Meta. When running locally, the app works as expected. However, when deploying, I've received a series of errors that I have been unable to solve. PythonAnywhere did not include meta.ai in its whitelist of sites, and Render and Vercel kept telling me that the requests were timing out, which has never been an issue when testing. I'd appreciate it if anyone could provide any alternatives to the platforms above that would enable me to deploy my app. Thank you in advance!

r/flask Aug 19 '24

Tutorials and Guides Any way to create a blog app which can have multiple images without using Markdown?

3 Upvotes

I am learning Flask by trying to build a blog app which can have several images through the blog. There is no fix number of images neither fix position for the image. First I thought the blog should be written in markdown which then be converted into HTML code. But I'm not sure if the images will get embedded properly.

Is there any better way to do it? I'm in a trouble here. Will appreciate any type of help. Thanks.

r/flask Jul 18 '24

Tutorials and Guides How to create flask REST API

11 Upvotes

Can someone explain to me like the proper way I can build a flask REST API, like a way that can be used in production. I looked into many blogs and videos and saw some of them just using jsonify to return data and some of them using entirely different packages? Which is the proper way?

r/flask Sep 18 '21

Tutorials and Guides A Compilation of the Best Flask Tutorials for Beginners

328 Upvotes

I have made a list of the best Flask tutorials for beginners to learn web development. Beginners will benefit from it.

r/flask Sep 11 '24

Tutorials and Guides Integrating Stripe with Flask: A Step-by-Step Tutorial

25 Upvotes

I recently put together a beginner-friendly tutorial on how to integrate Stripe into your Flask application. If you're looking to implement payment processing but feel a bit overwhelmed, this guide breaks down the steps in a straightforward manner.

One of the key aspects of the tutorial is setting up user authentication to manage payments and subscriptions securely. We cover everything from user registration and login processes to implementing Stripe subscriptions and webhooks for handling payment events.

Additionally, you'll find snippets of code provided, which you can use as a handy template. By the end of it, you'll be equipped to start monetizing your Flask app with Stripe.

Here's what you can expect from the post: - Setting up Stripe and your Flask app environment. - Implementing user authentication using Flask-Login. - Creating a checkout session for subscriptions. - Handling webhooks to update subscription status in your database. - Differentiating between free and premium content based on user subscriptions.

You only need a Stripe account to get started. For anyone interested, check out the full guide here: Integrating Stripe with Flask

r/flask Nov 25 '24

Tutorials and Guides Deploying Flask-based Microservices on AWS with ECS Service Connect

6 Upvotes

The playlist is broken into six parts:

  1. An introduction to ECS Service Connect and the various AWS components that will be used
  2. Run the flask-based microservice architecture locally before diving into AWS
  3. Get the flask-based microservice architecture **just working** on AWS. We'll rely on a lot of the defaults provided by AWS on the networking to get a working example quickly that you can see in action on AWS
  4. We'll do the same as the previous video, but not rely on default networking setup by AWS. We'll configure networking ourselves with the recommended AWS approach so the app is production-ready
  5. Use GitHub Actions to automate deployments to our flask app code running on our microservice architecture on AWS
  6. Run a CDK (Cloud Development Kit) script that will create both the AWS networking components, as well as the ECS components. After running the script with a single `cdk deploy --all` command, the microservice architecture will be fully functional

This tutorial truly is end-to-end. If you enjoy the content, you can help me a ton by doing any or all of the following:

Any questions or requests, just leave a comment.

r/flask Jul 15 '24

Tutorials and Guides Docker for Flask

9 Upvotes

I have been trying to look for online solutions and practices followed but generally they do it for the flask template app which does not cover the cases for real-world large scale applications. I personally have worked on numerous flask applications but while deploying am never successful in actually implementing the Dockerfile. Kindly guide me on how to tackle this.

r/flask Oct 29 '24

Tutorials and Guides Let's learn flask, our favourite micro framework

Thumbnail
flask-india.hashnode.dev
11 Upvotes

Hi guys, kindly visit the blog inspired by a Telegram group to help fellow python developers to get started with the wonderful world of flask and Backend development in general. We plan to slowly extend the blog with helpful articles catering to a range of topics.

r/flask Nov 19 '24

Tutorials and Guides Example app with SAML support, built with Python + Flask + SSOReady

Thumbnail
github.com
1 Upvotes

r/flask May 23 '24

Tutorials and Guides What is gunicorn and wsgi?

26 Upvotes

Hi everyone i know i can seaech in google amd i did but i want to ask of there is any content that explain well this things and how it works, thanks!

r/flask Nov 04 '24

Tutorials and Guides How to curlify a flask request

0 Upvotes

A function that turns a flask request into a curl command.

Install curlify from pip to use

import curlify

def curlify_flask(request):
  req = request
  req.body = req.data
  return curlify.to_curl(req)

r/flask Nov 10 '24

Tutorials and Guides Building User Interfaces in a web app using Flask

0 Upvotes

Kindly visit the link to learn the building blocks for a web app in Flask. Also spread the word and let's learn together.

https://flask-india.hashnode.dev/building-user-interfaces-in-flask

r/flask Oct 30 '24

Tutorials and Guides Let's use Pydantic, new kid on the block with Flask, shall we?

Thumbnail
flask-india.hashnode.dev
5 Upvotes

Spread the good word and let there be light.

r/flask Nov 01 '24

Tutorials and Guides Using Flask with Marshmallow

Thumbnail
flask-india.hashnode.dev
2 Upvotes

Kindly visit the blog to get a brief idea about using barebones Marshmallow library for validation with Flask micro framework.

r/flask Jul 26 '24

Tutorials and Guides How to debug in Flask

2 Upvotes

As there are many files which we create while building an application using flask. Each file is dependent on other in this case how to debug a code? How to find where exactly we are getting stuck?

Thanks for your help in advance.

r/flask Apr 14 '24

Tutorials and Guides Flask Deployment on AWS ECS

3 Upvotes

Hello! I have a fitness application that has around 3000 daily active users. Now, I want to scale it horizontally and I want to deploy it on AWS ECS and I am facing trouble with security groups, services, rules. Basically, I have never deployed on AWS before. Now, I want to deploy it on short notice for production. So, Kindly share any quick related helpful tutorial or guide. Thanks! PS: Currently It’s on digital ocean droplet and I have created docker image already and uploaded on amazon elastic registry. Image runs well on local. I have attached RDS with it. Having trouble connecting to Document Cluster.

r/flask Sep 06 '24

Tutorials and Guides How To Perform Unit Testing in Flask

Thumbnail
digitalocean.com
12 Upvotes

r/flask Jun 25 '24

Tutorials and Guides Help with Flask project

11 Upvotes

Hi, I'm a student currently who has a flask assignment to build a API webserver. I've missed out on a few lessons (I've been sick) and now I'm lost af. I don't know what I'm doing and im stressed out.

Is anyone free to link up on discord? And walk me through a few things?

r/flask Jun 16 '24

Tutorials and Guides Flask content creators

6 Upvotes

Are there any Flask content creators on youtube/twitter/anywhere that you follow and who share some mediocre to advanced level use of it?

r/flask Jul 28 '24

Tutorials and Guides system design and oops

3 Upvotes

Can anyone suggest me good platform where i can work on Object oriented design and play with OOPs concept so i can ace in SDE interviews.

r/flask Jan 10 '24

Tutorials and Guides How can I deploy my api for free

1 Upvotes

https://github.com/Ayushsinha106/NovelSearchFlask

This is my github repo I first deploy it on render but whenever i'm fetching the api it giving me error How can I deploy it properly anyone help

r/flask Sep 11 '24

Tutorials and Guides Live Polling App Python Flask

Thumbnail
youtu.be
4 Upvotes

Here's how to build a live polling app with flask and AJAX using MySQL database

r/flask Aug 01 '24

Tutorials and Guides Hosting Help

5 Upvotes

Hi, I have 3 sites pointing to 1 IP address hosted by Linode ubuntu. I did not have to do much when setting this up, all was auto filled by Linode when adding domain names.

I want to change my VPS from Linode to a new provider that supports only IPv4. The new service only gives me the vps, there is no interface like Linode where I can add domain names point to the VPS IP.

Could anyone provide guidance on how to setup my domains to point to my new vps IP?

my domains are with with 2x godaddy, 1x namecheap.

r/flask Mar 11 '24

Tutorials and Guides Hosting Flask + Docker website

11 Upvotes

Morning everyone! For the last 18 or so monts I've been developing a chatbot-esque project using Flask and wanted to host the website online. I'm far from a front end dev and don't have any experience with this sort of thing, but have been wrestling with AWS (Lightsail, ECS, and EC2), Kamatera, ngrok, and PythonAnywhere over the past few weeks in hopes I can get something off the ground. Errors generally come down to something timing out one way or another.

I'm able to build and run the raw Python and the docker container containing the website (can be opened locally and on other devices connected to my apartment building's network) but each container hosting system I've tried won't work. Being my first time trying something like this, an 11GB container doesn't seem too large but maybe that's just my inexperience talking.

Long story short; if anyone has any tips on how to host a Flask app (either using docker or not - at this point I just want to get it up and running) online, I'd really appreciate your wisdom. Also; project repo in case that helps.

Cheers :D