
Who is this course for and why take this course?
This course covers development using React and Django, with a focus on test-driven design and mocking. Jest and Testing Library will be used for testing React. React Context will be used as the state management system. Deployment to Azure using infrastructure-as-code is covered, using Azure Kubernetes, Azure Key Vault, Azure VPN, Azure Private DNS, and Azure PostgreSQL.
Who is your instructor?
Course requirements include programming experience, local admin access to your workstation, an Azure account, and software such as VS Code, Powershell 7.2, Azure CLI, Python, Node, kubectl, and Helm.
Discuss the design considerations for deploying a React application into Azure. This lesson compares Azure Storage Accounts, Azure Static Web Apps, Azure Container Apps, Azure App Service, and Azure Kubernetes Service. It also covers the topic of containerization and running React apps with nginx instead of using npm.
This lesson explains the design in Azure that will allow an application to be developed and deployed in a secure fashion, and how to work with Azure DevOps Repo, Azure DevOps Pipeline, Azure VPN, Azure Key Vault, Azure Kubernetes, Azure Private DNS, and Azure PostgreSQL.
See the source code at various stages in my GitHub repository.
Install React Bootstrap
Create the tests in preparation for updating the Django user model to use the email address field instead of the user name.
Update the Django user model to use the email address as the username, and add additional fields that will be used by the application to verify the user's email.
Create tests to ensure the user registration endpoint can:
Create a user
Create a user with the correct field values
Returns an error if the name is not provided
Returns an error if the email is not provided
Returns an error if the password is not provided
Learn how to mock functions and analyze calls to them.
Make Django pull settings from the environment variables.
Use the Django crypto function to generate a random string that will be used to verify a user's email. Create tests using Regex to verify the URL strings being sent in emails to the user.
Create tests and code to use Django and Simple JWT to issue access tokens and refresh tokens using the Django REST Framework.
This lesson will show how to use the REST framework to check that a user is authenticated before providing a response. This lesson will also show how to create a user serializer to encode user data as an HTTP response.
Create an endpoint to update certain fields in the database, and ensure database update calls are only made when necessary.
Test an HTTP error code is returned when unexpected HTTP methods are used to call the endpoint.
Send an email to a user. Mock the send mail function to ensure it is called and with the proper parameters. General a random string of characters. Use Regex to test strings. Setup Django to pull settings from the environment variables.
Demonstrate how test driven design makes correcting mistakes quick and easy.
Use try/except statements to get the user for a password reset.
Debugging an issue using the browser inspection tool and console log messages.
Create a Docker image for the backend Django server. Set environment variables in the running container. Use gunicorn to run Django in a container.
Create an nginx container image to serve static files for the Django administration site.
In this lesson we will configure the Django server to read the STATIC_URL setting from an environment variable or use the default.
In this lesson we will add print statements to show non-sensitive variables when the container is running, to hep with debugging issues. This lesson will also show how to load container environment variables from a file.
Update the nginx configuration to properly deal with HTTP requests when a page is reloaded or a user goes directly to a specific link on the site.
Discuss the benefits of infrastructure as code, include:
Allows for deletion of environments and easy recreation, resulting in cost savings.
A method of disaster recovery or incident response.
Duplicate environments for other projects.
Change Management And Documentation
Create an Azure Container Registry using the "az acr" command
Upload container images using docker push to the azure container registry (ACR)
Create an Azure Keyvault
Demonstrate how to span multiple lines for a Powershell command.
Create a Kubernetes ConfigMap to allow reconfiguration of the frontend application image.
Learn how to create an Azure VPN Gateway to allow your development staff to securely access your development environments.
This lesson will show how to set up a private DNS zone and then connect it to a virtual network.
Grant permissions for AKS to interact with the local subnet so Kubernetes can set up a private ingress.
Configure the frontend application to use the internal ingress, and then create a private DNS record to access the application over the VPN.
Deploy the backend Django container that is running Gunicorn. Debug container issues with kubectl describe pods. Use the --watch parameter to monitor the status of Kubernetes.
Configure the Django application to read the ALLOWED_HOSTS from an environment variable. Configure the Django application to use CORS_ALLOWED_ORIGINS, which indicates which origins are valid for making requests to Django.
This course is meant to provide you with some real-world examples of building React and Django applications using test driven design. React Context will be used for state management in the front end application. Django will be used as an API back end application, using the Django REST framework. You will use Azure DevOps Repo to store application source code and use Azure Pipelines to automate the building and testing of the code. You will learn to package the applications in containers and deploy them into a development Azure Kubernetes Service environment that is not accessible to the Internet. Nginx will be used to serve the static files for the React front end and the Django administration site. You will deploy a private PostgreSQL database for the backend application, keeping the data safely off the Internet. Using an Azure VPN to connect to the development environment, you will be able to confirm the application functionality. PGAdmin will be used to connect to the database over the VPN. Proper management of secret information, such as database passwords and email passwords, will be addressed by integrating Kubernetes with Azure Key Vault. You will also learn to perform Django database migrations in cloud environments. After performing security testing in the development environment, you will create the production environment and deploy the application to the public.