Skip to content

DefangSamples/sample-django-postgres-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django & Postgres

1-click-deploy

This template is a customer relationship management list project developed using Python Django framework, offering a starting point to help you quickly build your customer management system. We use PostgreSQL as the database. We have prepared all the essential files for deployment. By spending less than 10 minutes setting up the environment, as detailed in the prerequisites, and executing the commands in our step-by-step guide, your website will be ready to go live to the world!

Prerequisites

  1. Download Defang CLI
  2. (Optional) If you are using Defang BYOC authenticate with your cloud provider account
  3. (Optional for local development) Docker CLI

Development

To run the application locally, you can use the following command:

docker compose up --build

Configuration

For this sample, you will need to provide the following configuration:

Note that if you are using the 1-click deploy option, you can set these values as secrets in your GitHub repository and the action will automatically deploy them for you.

POSTGRES_PASSWORD

The password for the PostgreSQL database.

defang config set POSTGRES_PASSWORD

SECRET_KEY

The secret key is used to secure the Django application.

defang config set SECRET_KEY

ALLOWED_HOSTS

The allowed hosts for the Django application. (i.e. the domain your app runs on)

defang config set ALLOWED_HOSTS

Deployment

Note

Download Defang CLI

Defang Playground

Deploy your application to the Defang Playground by opening up your terminal and typing:

defang compose up

BYOC (AWS)

If you want to deploy to your own cloud account, you can use Defang BYOC:

  1. Authenticate your AWS account, and check that you have properly set your environment variables like AWS_PROFILE, AWS_REGION, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY.
  2. Run in a terminal that has access to your AWS environment variables:
    defang --provider=aws compose up

Title: Django & PostgreSQL

Short Description: A customer relationship management list project developed using the Python Django framework, offering a starting point to help you quickly build your customer management system.

Tags: Django, PostgreSQL, Python, SQL

Languages: python

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5