SMahdiS
SMahdiS

Reputation: 940

Django installed_apps does not recognise my app?

This is my installed apps section in settings.py.

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'homepage.apps.HomepageConfig',
.
.
.
]

My app name is "homepage" and I really can't remember why I changed it to 'homepage.apps.HomepageConfig', but whatever it is, it worked on my machine.

Now, i uploaded my files to server, installed required apps, did the migrations, but i noticed django does not create my "homepage" app table and does not migrate anything from my app. And my website returns the error: table homepage_post does not exist.

What is wrong?

Upvotes: 0

Views: 1776

Answers (1)

Szymon P.
Szymon P.

Reputation: 1148

Check if in homepage app directory You have file named __init__.py and apps.py. The content of apps.py should be:

from django.apps import AppConfig

class HomepageConfig(AppConfig):
    name = 'homepage'

Upvotes: 1

Related Questions