Cody Blog

Notes of using Django in Azure App Service

DebugConsole

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

https://{YOUR_PROJECT_NAME}.scm.azurewebsites.net/DebugConsole

Migrate django database in Azure

  1. Go to D:\home\site\wwwroot directory

  2. Exceute migrate command

    D:\home\site\wwwroot> .\env\Scripts\python.exe manage.py migrate

Create super user

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

Adjest timezone

Go to azure portal,

WEBSITE_TIME_ZONE

Set WEBSITE_TIME_ZONE to anyvalue defined in here: https://technet.microsoft.com/en-us/library/cc749073(v=ws.10).aspx …