Django Docker NGINX app for Production Deployment

Django app for deployment an app for production.

Python Django application exposes two endpoints:

  • GET /num_to_english?number=12345678

  • POST /num_to_english

    {
    “number”: “12345678”
    }
    

This endpoints will convert any number given to it into the english words that describe that number. For example the above request should return:

{
“status”: “ok”,
“num_in_english”: “twelve million three hundred forty five thousand six hundred seventy eight”
}

How to run

  1. Update the .env file. You have to copy the .env.example update it accordingly (only for production) and rename it to .env
    • For deployment: Run docker compose -f docker-compose-deploy.yml up --build and you can access the ALLOWED_HOSTS in the .env file on the port 8080
    • For local developmnet: Run docker compose -f docker-compose.yml up --build and you can access http://localhost:8000