lundi 3 mai 2021

Struggling with adding app to INSTALLED_APPS Django

I have no idea, this always worked for me, but without motivation, it's not working now.
what i did:

  1. I created my project
  2. I created my app
  3. I added my config to INSTALLED_APPS
  4. I get this error: django.core.exceptions.ImproperlyConfigured: 'champ.apps' does not contain a class 'ChampConfigcorsheaders'. Choices are: 'ChampConfig'.

My project looks like this:

  • Championship_3bi
    • champ
      • all the files of the app
    • Championship_3bi
      • all the files of the project

This is my settings.py:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'champ.apps.ChampConfig'  #this is the line that create the "error"
    'corsheaders',
]

I've also tried to do champ.apps.ChampConfigcorsheaders but it didnt work.


This is my champ/apps.py:

from django.apps import AppConfig


class ChampConfig(AppConfig):
    name = 'champ'


i searched for everything but looks like i was the only one who get this error.
The reason why it does not work is for the weird name of my project?
Why it is not working for only this project?
im done




Aucun commentaire:

Enregistrer un commentaire