[점프 투 장고] 3-05 로그인 관련 질문
안녕하세요! 점프 투 장고 위키독스 참고해서 공부하고 있는 학생입니다.
좋은 책 만들어주신 덕분에 감사히 공부하고 있습니다!
제목과 같이 질문이 있어서 게시글 남기게 되었습니다.
3-05에서 common 앱을 만드는 과정에서 에러가 계속 생깁니다.
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/opt/anaconda3/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/opt/anaconda3/lib/python3.8/threading.py", line 870, in run
self._target(self._args, self._kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/django/utils/autoreload.py", line 54, in wrapper
fn(args, kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/opt/anaconda3/lib/python3.8/site-packages/django/utils/autoreload.py", line 77, in raise_last_exception
raise _exception[1]
File "/opt/anaconda3/lib/python3.8/site-packages/django/core/management/init.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "/opt/anaconda3/lib/python3.8/site-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, kwargs)
File "/opt/anaconda3/lib/python3.8/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/opt/anaconda3/lib/python3.8/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/opt/anaconda3/lib/python3.8/site-packages/django/apps/config.py", line 116, in create
mod = import_module(mod_path)
File "/opt/anaconda3/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
File "
File "
File "
File "
File "
File "
ModuleNotFoundError: No module named 'common.apps.CommonConfigpybo'; 'common.apps' is not a package
위와 같은 에러인데 맨 마지막 줄이 문제있는 듯 하여 여러 방법을 시도해보았지만 문제가 해결되지 않아 질문 올립니다ㅠ
앞 부분은 제 컴퓨터 환경 때문에 디렉토리명 등이 조금씩 다르긴 하지만 내용은 모두 똑같이 따라했습니다..
답변 주시면 감사하겠습니다...!
lot9616 님 343
2021년 12월 26일 5:52 오후
2개의 답변이 있습니다. 1 / 1 Page
"""
Django settings for config project.
Generated by 'django-admin startproject' using Django 2.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '9ay#7w-_bm=)1pt54)bl+emut-^i4m#grk5ahqj91$w49-gm5z'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'common.apps.CommonConfig'
'pybo.apps.PyboConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'config.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR ,'/templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'config.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = 'ko-kr'
TIME_ZONE = 'Asia/Seoul'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR , 'static',
]
config 디렉토리에 있는 settings.py 입니다.
lot9616 님
2021년 12월 26일 8:34 오후