Q&A

책을 따라하다가 막히는 부분이 있나요?
질문을 남겨주세요.

P.443 : allauth.account 추가 에러 문의

3 years, 5 months ago

chshin1986@daum.net chshin1986@daum.net

이성용님, 안녕하세요.

좋은 책을 출판해 주셔서 많은 도움을 받고 있습니다.

16장의 회원가입 기능을 구현하는 중에 제가 혼자 해결이 어려운 사항이 있어서 질문을 드립니다.

allauth 모듈을 설치하고,   settings.py에 아래와 같이 앱을 등록하는 과정에서, 

    'allauth.account',

만 입력하고 나면, 아래 (-------)와 같은 에러가 발생합니다...

allauth 모듈을 재설치해도 마찬가지 현상이 발생하고, 흥미로운 것은 allauth.socialaccount.providers.google 은 에러가 발생하지 않습니다...


바쁘신 중이라도 한번 검토하시고 조언해 주시면 감사하겠습니다.

감사합니다.



INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_extensions',

'crispy_forms',
'markdownx',
'allauth',
'allauth.account', (이 항목만 포함되면 에러가 납니다...)


'blog',

'single_pages',

-------------------------------------------------------------------------------

(venv) λ python manage.py runserver

... ... ...

C:\Users\chshin\Documents\GitHub\Gonggan\gonggan_prj\settings.py changed, reloading.

Watching for file changes with StatReloader

Exception in thread django-main-thread:

Traceback (most recent call last):

  File "C:\Users\chshin\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner

    self.run()

  File "C:\Users\chshin\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run

    self._target(*self._args, **self._kwargs)

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper

    fn(*args, **kwargs)

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\core\management\commands\runserver.py", line 110, in inner_run

    autoreload.raise_last_exception()

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception

    raise _exception[1]

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\core\management\__init__.py", line 375, in execute

    autoreload.check_errors(django.setup)()

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper

    fn(*args, **kwargs)

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\__init__.py", line 24, in setup

    apps.populate(settings.INSTALLED_APPS)

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\apps\registry.py", line 114, in populate

    app_config.import_models()

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\apps\config.py", line 301, in import_models

    self.models_module = import_module(models_module_name)

  File "C:\Users\chshin\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import

  File "<frozen importlib._bootstrap>", line 991, in _find_and_load

  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 783, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\allauth\account\models.py", line 13, in <module>

    from .adapter import get_adapter

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\allauth\account\adapter.py", line 31, in <module>

    from ..utils import (

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\allauth\utils.py", line 13, in <module>

    from django.contrib.sites.models import Site

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\contrib\sites\models.py", line 78, in <module>

    class Site(models.Model):

  File "C:\Users\chshin\Documents\GitHub\Gonggan\venv\lib\site-packages\django\db\models\base.py", line 113, in __new__

    raise RuntimeError(

RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.




sungyong
sungyong   3 years, 5 months ago

settings.py에 django.contrib.sites가 빠져있는 것 같은데, 추가해도 마찬가지 상황이 계속되는지 확인해주시겠어요? 

Updated: June 21, 2021, 5:02 p.m.

Leave a Comment:
목록보기
Search
  • 자유게시판
  • Q&A