Using any tools to create advance blog with Django!
- Python 3 - Programming Language
- Django 4 - Powerful Web Framework
- Django Rest Framework - Web API's
- Gunicorn - WSGI HTTP Server
- PostgreSQL - PostgreSQL Database
- NginX - High performance web server
- Docker - Container Platform
First clone or download this project.
git clone https://github.com/dori-dev/dblog.git
cd dblog
Access Docker to use super user do
sudo usermod -aG docker ${USER}
Then create docker network and volumes as below.
docker volume create dblog_postgresql
docker volume create dblog_static_volume
docker volume create dblog_files_volume
docker network create nginx_network
docker network create dblog_network
Run django and postgresql with docker-compose.
docker-compose up -d
Then run nginx container with docker-compose.
cd config/nginx/
docker-compose up -d
You can see dblog web page on http://localhost/, Template and API's are accessible by docker containers which you can see with below command.
docker ps -a
Output should be like this.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
857914e957c2 nginx_dblog_nginx "/docker-entrypoint.…" 9 minutes ago Up 9 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp nginx_dblog_nginx_1
49d2308fcf9b dblog_dblog "gunicorn --chdir db…" About an hour ago Up About an hour 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp dblog_dblog_1
7b503cc55499 postgres:12 "docker-entrypoint.s…" About an hour ago Up About an hour 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp dblog_postgresql
dblog_nginx container as common web server, dblog container as django application and dblog_postgresql as postgreSQL database container.
docker exec -it dblog bash
Create admin user
python manage.py createsuperuser
You can see dblog admin web page on http://localhost/admin/ and create article.