0

I am working on a HR app using the small-small-hr set up in django. Getting this look up error when i run python manage.py runserver or makemigrations. Below is my code for apps.py and settings.py. What could be going wrong here?

apps.py:

from django.apps import AppConfig

class SmallSmallHrConfig(AppConfig):
    """
    Apps config class
    """
    name = 'small_small_hr'
    app_label = 'small_small_hr'
    def ready(self):
        # pylint: disable=unused-import
        import small_small_hr.signals  # noqa
        # set up app settings
        from django.conf import settings
        import small_small_hr.settings as defaults
        for name in dir(defaults):
            if name.isupper() and not hasattr(settings, name):
                setattr(settings, name, getattr(defaults, name))**

settings.py:

INSTALLED_APPS = [
    'small_small_hr.apps.SmallSmallHrConfig',
    'crispy_forms',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.sites.models.Site'**
]
ruddra
  • 50,746
  • 7
  • 78
  • 101
Muhuri.JSON
  • 163
  • 2
  • 14
  • 2
    add the python & django version with error traceback. – Nalin Dobhal Jan 16 '20 at 05:38
  • show your project directory structure – rahul.m Jan 16 '20 at 05:46
  • I am using python 3.7 and django version 2.2. I actually had a number of exceptions the initial one being: Traceback (most recent call last): File "C:\Users\hp\AppData\Roaming\Python\Python37\site-packages\django\apps\registry.py", line 155, in get_app_config return self.app_configs[app_label] KeyError: 'admin' During handling of the above exception, another exception occurred: raise LookupError(message) LookupError: No installed app with label 'admin'. self.fetch_command(subcommand).run_from_argv(self.argv) – Muhuri.JSON Jan 16 '20 at 06:34
  • @c.grey Project directory structure: C:. ├───.tox │ ├───.tmp │ └───log ├───hr │ └───__pycache__ ├───small_small_hr │ ├───migrations │ ├───templates │ │ └───small_small_hr │ └───__pycache__ ├───static └───tests └───fixtures – Muhuri.JSON Jan 16 '20 at 06:39
  • @Muhuri.JSON what is your sqllite version – rahul.m Jan 16 '20 at 07:17
  • @c.grey SQLite version 3.30.0 – Muhuri.JSON Jan 16 '20 at 07:31
  • @Muhuri.JSON refer this --> https://stackoverflow.com/questions/55512244/no-installed-app-with-label-admin-in-empty-django-2-2-project – rahul.m Jan 16 '20 at 07:54
  • @c.grey that helped thanks – Muhuri.JSON Jan 16 '20 at 08:36

1 Answers1

1

Downgrading to django 2.1 worked apparently django 2.2 isnt compatible with sqlite3

Muhuri.JSON
  • 163
  • 2
  • 14