인프런 커뮤니티 질문&답변

임권일님의 프로필 이미지
임권일

작성한 질문수

Do It! 장고+부트스트랩: 파이썬 웹개발의 정석

오류좀 봐주세요

작성

·

475

0

CreateView - 폼(form)으로 포스트 작성 페이지 만들기 강의에서

여기까지왔는데요

 

이런오류가 뜨네요

 

 

 

python manage.py runserver

Watching for file changes with StatReloader

Performing system checks...

Exception in thread django-main-thread:

Traceback (most recent call last):

File "C:\Program Files\Python310\lib\threading.py", line 1016, in bootstrapinner

self.run()

File "C:\Program Files\Python310\lib\threading.py", line 953, in run

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

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper

fn(*args, **kwargs)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\management\commands\runserver.py", line 134, in inner_run

self.check(display_num_errors=True)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\management\base.py", line 475, in check

all_issues = checks.run_checks(

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\checks\registry.py", line 88, in run_checks

new_errors = check(app_configs=app_configs, databases=databases)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config

return check_resolver(resolver)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\checks\urls.py", line 24, in check_resolver

return check_method()

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\urls\resolvers.py", line 494, in check

for pattern in self.url_patterns:

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\utils\functional.py", line 57, in get

res = instance.__dict__[self.name] = self.func(instance)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\urls\resolvers.py", line 715, in url_patterns

patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\utils\functional.py", line 57, in get

res = instance.__dict__[self.name] = self.func(instance)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\urls\resolvers.py", line 708, in urlconf_module

return import_module(self.urlconf_name)

File "C:\Program Files\Python310\lib\importlib\__init__.py", line 126, in import_module

return bootstrap.gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>", line 1050, in gcdimport

File "<frozen importlib._bootstrap>", line 1027, in findand_load

File "<frozen importlib._bootstrap>", line 1006, in findand_load_unlocked

File "<frozen importlib._bootstrap>", line 688, in loadunlocked

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

File "<frozen importlib._bootstrap>", line 241, in callwith_frames_removed

File "C:\github\do_it_django_inflearnb_2022\do_it_django_prj\urls.py", line 23, in <module>

path('blog/', include('blog.urls')),

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\urls\conf.py", line 38, in include

urlconf_module = import_module(urlconf_module)

File "C:\Program Files\Python310\lib\importlib\__init__.py", line 126, in import_module

return bootstrap.gcd_import(name[level:], package, level)

File "<frozen importlib._bootstrap>", line 1050, in gcdimport

File "<frozen importlib._bootstrap>", line 1027, in findand_load

File "<frozen importlib._bootstrap>", line 1006, in findand_load_unlocked

File "<frozen importlib._bootstrap>", line 688, in loadunlocked

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

File "<frozen importlib._bootstrap>", line 241, in callwith_frames_removed

File "C:\github\do_it_django_inflearnb_2022\blog\urls.py", line 6, in <module>

path('tag/<str:slug>/', views.tag_page),

AttributeError: module 'blog.views' has no attribute 'tag_page'

답변 5

0

임권일님의 프로필 이미지
임권일
질문자

 

 

한번만 원격으로 해주면 안될까요??

 

부탁합니다

 

조금만더 하면 완성 하는데

 

계정도 다 날라간거같아요

 


image

0

SungYong Lee님의 프로필 이미지
SungYong Lee
지식공유자

안녕하세요. 강의의 오류는 아닌 것 같습니다.

따라하시다가 마이그레이션 실수를 하신 것 같네요.

db를 삭제해도 되는 경우라면, 일단 db.sqlite3 파일을 삭제하시고, blog를 비롯한 모든 폴더의 migrations 폴더를 삭제하세요.

그리고

python manage.py makemigrations blog

python manage.py migrate

를 실행시키면 될 것 같습니다.

자세한 내용은 아래 링크를 참고해보세요.

https://www.jgahn.com/archive/post/40/

 

0

임권일님의 프로필 이미지
임권일
질문자

django allauth - 소셜 로그인 구현하기 강의 에서

 

오류가있는데요

 

코드 다 하고

 

python manage.py migrate 했는데요

 

이런 오류가 뜨네요

 

Traceback (most recent call last):

File "C:\github\do_it_django_inflearnb_2022\manage.py", line 22, in <module>

main()

File "C:\github\do_it_django_inflearnb_2022\manage.py", line 18, in main

execute_from_command_line(sys.argv)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line

utility.execute()

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\management\__init__.py", line 395, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\management\base.py", line 330, in run_from_argv

self.execute(*args, **cmd_options)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\management\base.py", line 371, in execute

output = self.handle(*args, **options)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\management\base.py", line 85, in wrapped

res = handle_func(*args, **kwargs)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\core\management\commands\migrate.py", line 95, in handle

executor.loader.check_consistent_history(connection)

File "C:\github\do_it_django_inflearnb_2022\venv\lib\site-packages\django\db\migrations\loader.py", line 302, in check_consistent_history

raise InconsistentMigrationHistory(

django.db.migrations.exceptions.InconsistentMigrationHistory: Migration socialaccount.0001_initial is applied before its dependency sites.0001_initial on database 'default'.

0

임권일님의 프로필 이미지
임권일
질문자

삭제된 글입니다

SungYong Lee님의 프로필 이미지
SungYong Lee
지식공유자

urls.py에 create_post 뒤에 슬래쉬가 빠져서 그런게 아닐까요?

0

SungYong Lee님의 프로필 이미지
SungYong Lee
지식공유자

맨 마지막에 오류 메시지를 보면 views.py에 tag_page라는 attribute가 없다고 하네요.

views.py에 tag_page가 잘 작성되어 있는지 확인해보세요.

임권일님의 프로필 이미지
임권일

작성한 질문수

질문하기