Notes of using Django in Azure App Service

Datetime:2016-08-22 22:25:27         Topic: Windows Azure  Django          Share        Original >>
Here to See The Original Article!!!


There is an debug conolse that you can exectue some commands for Django related tasks:

Just go to https://{YOUR_PROJECT_NAME}

Migrate django database


.\env\Scripts\python.exe migrate

Create super user

echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', '', 'your_password')" | python shell

Adjest timezone

Go to azure portal ,


Set WEBSITE_TIME_ZONE to anyvalue defined in here:

Create Django Project

  1. Create Azure Django App (+ New) >

  2. Set enable git deployment / Config credentials

  3. Get git clone url, ex:

  4. git push

Set static file

Edit your web.config in repository root folder:

In the following cases, we map /static and /uploads to static and uploads in repository

    <rule name="Static Files" stopProcessing="true">
        <add input="true" pattern="false" />
    <rule name="Configure Python" stopProcessing="true">
        <match url="(.*)" ignoreCase="false" />
        <add input="{REQUEST_URI}" pattern="^/(static|uploads)/.*" ignoreCase="true" negate="true" />
        <action type="Rewrite" url="handler.fcgi/{R:1}" appendQueryString="true" />


Put your ads here, just $200 per month.