Focus on deploying a simple Flask Application into Heroku, interacting with PostgreSQL and Troubleshooting

By Medium - 2021-03-17

Description

Flask is the tool that can be used to create API server. It is a micro-framework, which means that its core functionality is kept simple, but there are numerous extensions to allow developers to add…

Summary

  • Focus on the backend, without frontend and authentication Flask is the tool that can be used to create API server.
  • Create below 6 files that are needed for the application models.py which defines the PostgreSQL database, table, and the configuration Run local migrations We can run our local migrations using our file, to mirror how Heroku will run behind the scenes for us when we deploy our application.
  • uncomment at the first time running the app """ db_drop_and_create_all() 2. check models.py and compare that to what is in your database actually.

 

Topics

  1. Database (0.26)
  2. Frontend (0.06)
  3. Backend (0.05)

Similar Articles

Python and MySQL Database: A Practical Introduction

By realpython - 2021-01-22

In this tutorial, you'll learn how to connect your Python application with a MySQL database. You'll design a movie rating system and perform some common queries on it. You'll also see best practices a ...

Dump and load a database in Neo4j Desktop

By Graph people - 2020-11-11

Have you ever wanted to share a database you created in Neo4j Desktop with your colleague but not sure exactly how to go about it? Maybe you want to clone the database locally to perform various write ...

How to Create an Index in Django Without Downtime

By realpython - 2020-12-06

In this step-by-step Python tutorial, you'll get a solid understanding of the limitations of Django migrations by tackling a well known problem: creating an index in Django with no downtime.

Introduction to Python SQL Libraries

By realpython - 2020-12-28

In this step-by-step tutorial, you'll learn how to connect to different database management systems by using various Python SQL libraries. You'll interact with SQLite, MySQL, and PostgreSQL databases ...

How to Build a Serverless Application Using AWS SAM

By freeCodeCamp.org - 2020-10-19

In my previous article, I talked about how AWS Chalice helps you quickly build a Python-based serverless application and deploy it on AWS within a few minutes. While it was a quick and fun prototype, ...