RESET Django virtural Environment

May 23rd 2020 by jyoon

Django 가상환경에 문제가 생겨 Django프로젝트 가상환경수정, 쿠키커터 재설치, 디비 설정 재설정을 했습니다.

virtual environment에 문제 생김

Third party가 설치가 안돼서 다시 설치

  • 해결방법

    • taggit third party 설치가 안되서 다시 설치

    img/Untitled_2.png

    • taggit_serializer third party 설치

    img/Untitled_3.png

    • THIRDPARTYAPPS에 설치 안된것 설치 Python manage.py runserver 하니 THIRDPARTYAPPS에 설치가 안된것들이 있어서 설치 위에 두개 "taggit , taggit_serializer" 설치

    img/Untitled_4.png

DB 관련 오류 발생

  • 문제

    django.db.utils.OperationsError: FATAL: role "root"does not exist

    img/Untitled_5.png

    Progress yoongram 확인해보니 아래와 같은 permission 에러.

    img/Untitled_6.png

  • 해결방법

    base.py 파일에 DATABASES.default 설정을 아래 post gress servet Settings와 같이 변경으로 해결

    img/Untitled_7.png

    img/Untitled_8.png

    • DB(progress) 문제 없나 확인 - table list, select 부터 확인 진행

    https://stackoverflow.com/questions/769683/show-tables-in-postgresql

로그인 문제

  • 문제

    • 크롬 로그 500 error

    img/Untitled_9.png

    • 서버 로그 이 문장이 포인트

    RuntimeError: You called this URL via POST, but the URL doesn't end in a slash and you have APPENDSLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/rest-auth/login/ (note the trailing slash), or set APPENDSLASH=False in your Django settings.

    img/Untitled_10.png

  • 해결

    • 서버만 올리고 front-end는 npm stat로 develop 버전으로 접속해서 로그인해야 하는데 생기는 문제
    • /Users/jaeyoonyoon/development/yoongram/frontend 에서 npm start로 react 구동으로 접속해 로그인하면 완료만세

    img/Untitled_11.png

확인했던 stackoverflow