Skip to content
This repository has been archived by the owner on Jan 9, 2022. It is now read-only.

paulonteri/django_azure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django on Azure

The web application used as an example in my writing of the article on Serverless Python on Azure: Django hosted on Azure App Service

Tech

Written in Python3 and Django 3.1.1.

Setup

  • First, clone the repository:
git clone https://github.com/django_azure/core.git
cd django_azure
  • Create a virtual environment to install dependencies in and activate it:
mkvirtualenv <envname>
source <envname>/bin/activate
  • Install requirements in the virtual environment created:
pip install -r requirements.txt
  • Run database migrations with this command
python3 manage.py migrate
  • Run server to ensure everything is working properly.
python3 manage.py runserver

Article Introduction

Over time, one of the most tiresome and non-rewarding tasks to some developers I know is the setup, maintenance and scaling of servers. Something often goes wrong.

Don't get me wrong, some developers like me enjoy that process. However, it doesn't scale well and the repetition of tasks can get tiring.

Doing all of this on your own can take some time:

  • Operating system maintenance
  • Capacity Provisioning - increase or reduce servers(or capacity) to handle different traffic
  • Availability and fault tolerance
  • Load balancing
  • Networking

It's not a wonder that many companies like Netflix, Uber, CodePen, etc are using Serverless technology.

This article will cover the basics of deploying a basic Django(Python) application to Azure App Service, a serverless offering by Microsoft Azure. This will allow you to stop stressing or even stop thinking about servers in your development lifecycle.

What we'll cover:

  • What is Serverless anyway? 👀
  • Azure App Service
  • Django Application setup
    1. Setting up a basic Django application
    2. Pushing the code to GitHub
  • Deploying to Azure App Service
    1. Provisioning the target Azure App Service
    2. Deploy to App Service from GitHub
    3. Your App is now Deployed! 😎
  • What Next?

Prerequisites:

  • Basic web development understanding.
  • Experience with git and GitHub. Here's a simple guide.
  • Basic Python and Django experience. (If you'll follow the exact steps under the app setup)
  • An Azure Account. (If you'll deploy)

...


About me

I ❤️ anything around Software Development.

I currently work as a Frontend Dev at a company called Inuua Tujenge, working with React, React Native and Django (Python & JavaScript) almost daily.

Check out my most recent project - a Remote Code Execution Engine like the ones on HackerRank and Leetcode. It currently supports Python, JavaScript, Java, Go, C#, etc.

Feel free to connect with me. 👌

Thanks for your valuable time.