Push Django images to a registry
In this tutorial, you take a container image of a Python Django app you built locally and deploy it to Azure Container Registry (ACR) or Docker Hub.
Create a container registry
Create a container registry to push images to. For more information about how to authenticate to and work with registries, see Using container registries.
Make sure that the registry endpoint you created is visible under Registries in the Docker Explorer of VS Code:
Settings for Django apps
-
In your Django project's
settings.py
file, modify theALLOWED_HOSTS
list to include the root URL to which you intend to deploy the app. For example, the following code assumes deployment to an Azure App Service (azurewebsites.net) named "vsdocs-django-sample-container":ALLOWED_HOSTS = [
# Example host name only; customize to your specific host
"vsdocs-django-sample-container.azurewebsites.net"
]