Django deployment on Azure App Service -- makemigrations fails with "no installed app"

Sydney 0 Reputation points
2024-06-17T17:01:51.1066667+00:00

Hi,

I am learning Django and followed the following tutorial:

https://learn.microsoft.com/en-us/training/modules/django-deployment/1-introduction

I actually started by deploying a different basic app following these instructions. Once I got this error, I decided to follow the steps exactly and use the MS Learn sample app. Either way, I get the same error.

Once I SSH into the app and try to run makemigrations I get an error: "No installed app with label 'dog_shelters'. Makemigrations works perfectly locally.

Here's my installed apps from settings.py:


INSTALLED_APPS = [
    'dog_shelters.apps.DogSheltersConfig',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'crispy_forms',
]

And the class definition from apps.py:

from django.apps import AppConfig


class DogSheltersConfig(AppConfig):
    name = 'dog_shelters'

Here's my directory structure in case it's helpful:

User's image

And a few lines showing the files correctly deployed:

(antenv) root@dog-shelters-test-app_1e018010:/tmp/8dc8ee8fd212757# ls ./
antenv  db.sqlite3  dog_shelters  manage.py  project  requirements.txt  venv  
(antenv) root@dog-shelters-test-app_1e018010:/tmp/8dc8ee8fd212757# ls ./project/
asgi.py  azure.py  __pycache__  settings.py  urls.py  wsgi.py

I have double-checked each step in the tutorial and cannot figure out where I went wrong.

Thank you!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,325 questions
0 comments No comments
{count} votes