Skip to content

Docker for python framework of Django 3 with PostgreSQL and Redist Latest.

Notifications You must be signed in to change notification settings

djono/docker-python-framework-django3-postgre-redist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django 3 with PostgreSQL and Redis

Spesification :

  • Linux Debian 11 (Bullseye)
  • Python 3.11.4
  • PostgreSQL 15.3
  • Django 3.2.19
  • Redis 7.2/latest

Beberapa file yang perlu dikonfigurasi :

Several files that needed to be configured :

  1. ./.env
  2. ./requirements.txt
  3. ./src/settings.py

Menjalankan aplikasi Django pada Docker

How to run docker django app

  1. Build docker image
docker-compose build
  1. Run docker container
docker-compose up -d
  1. Create database
docker-compose exec web python manage.py migrate
  1. Create superuser
docker-compose exec web python manage.py createsuperuser
  1. Collect static files
docker-compose exec web python manage.py collectstatic
  1. Run django app
docker-compose exec web python manage.py runserver
  1. Open browser and type the url addres : https://localhost or https://localhost:8080

That's it! & Good luck!
by mazjohn.com

References:
https://github.com/docker/awesome-compose/tree/master/official-documentation-samples/django