Skip to content

biniamhailu/LEGO-Starred-Sets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postgres-backed Flask Server Template

This is a template repository for setting up a basic Flask app backed by a Postgres database.

Developing in VS Code with the Remote Development Extension Pack

VS Code offers a feature that lets you use a Docker container as your full-time development environment.

Install the Remote Development Extension Pack, and then when you open a project that has a .devcontainer folder/file, VS Code will prompt you to re-open the project inside a container. This can take several minutes to set up on the initial run, but should be quicker afterwards

This will make it so that all necessary system and project dependencies are installed all at once. Neat!

Codebase Summary

This repo consists of a Postgres database, a pgAdmin web server, and a Python Flask web server application skeleton.

Seeding the database

If you wish to initialize the database upon creation, you can add .sql files in a /.devcontainer/pg_init folder. See the postgres docker readme for details.

Running the Flask Application

Inside the integrated terminal in VS Code, type

flask --debug run

This will run the server bound to TCP port 5000. You can then make HTTP calls to http://localhost:5000

Connecting to the pgAdmin DBMS instance

You can use the included dbms instance by opening http://localhost:5050 in a browser window and entering the following credentials:

username: admin@admin.com

password: root

Database server credentials from the "Add New Server" dialog):

Connection -> Host: db Connection -> Username: postgres Connection -> Password: postgres

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published