Deploying a Django project on Microsoft Azure

1. Deploy Azure Virtual machine

1-1. Go to the Virtual Machine

1-2. Add Virtual Machine with +Add button

  • I chose Ubuntu Sever 18.04 LTS because I personally like Ubuntu and I'm currently using Ubuntu 18.04.4 LTS.

  • Other options are totally up-to your app's condition

1-3. When your server deployment is finished, go to overviews

  • Copy your server's IP address (you'll need it when you edit deploy.json)

2. Upload & Deploy your Django project with Fabric3

2-1. Install Fabric3

2-2. Add fabfile.py and edit deploy.json & move them into your project (where manage.py exists)

fabfile.py

deploy.json - edit it!

  • I had to modify fabfile.py several times because of the errors

  • Check the error messages & google it!

    • It could take some time, but I'm pretty sure that is worth it

2-3 . Execute new server

  • Install python3, apache2, and mod_wsgi to run django

2-4. Deploy code through Fabric3

  • Fetch latest code on your github repo and migrate db

2-5. Create superuser

3. Congrats! Now you are live

Last updated