일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- 오류
- Uncaught SyntaxError
- include
- error
- 마이그레이트
- 마이그레이션
- Migrate
- 조맹클래스101
- ValueError
- scotty
- JavaScript
- Django
- junny
- 크로키
- TemplateSyntaxError
- 알리
- 취미미술
- navbar
- You should consider upgrading
- 조맹크로키
- ModuleNotFoundError
- bootstrap4
- 블린이
- pip install --upgrade pip
- Python
- Today
- Total
목록웹 세상/django (9)
내가 하고 싶은 것들 중 하나

문제상황 가상환경 venv에 있었고, 이미 pip install python-decouple 을 통해 디커플을 인스톨 후 임포트 했지만, from 에 빨간 밑줄이 뜨고 import 할 수 없다고 떴다 from decouple import config # Unable to import decouple 해결과정 구글링 https://github.com/Microsoft/vscode-python/issues/1185](https://github.com/Microsoft/vscode-python/issues/1185) https://code.visualstudio.com/docs/python/environments#_choosing-an-environment python interpreter 설정을 해준다 F1..

cdn 이용하기 bootstrap4 홈페이지에서 cdn 링크 복사해서 css는 head 닫는 태그 안쪽에, javascript는 body 닫는 태그 안쪽에 추가하기 https://getbootstrap.com/docs/4.5/getting-started/introduction/ {% load bootstrap4 %} 이용하기 {% load bootstrap4 %} {% bootstrap_javascript jquery='full' %} {% load bootstrap4 %} 해주고, css head 닫는 태그 안쪽에 한 줄, javascript jquery body 닫는 태그 안쪽에 한 줄이면 끝남! ㅎㅎ
문제상황 마이그레이션과 마이그레이트 시도 중에 마이그레이션은 성공 했으나 마이그레이트는 되지 않고 ValueError가 떴다. ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'accounts.account', but app 'accounts' doesn't provide model 'account'. 해결과정 https://stackoverflow.com/questions/50324561/valueerror-the-field-admin-logentry-user-was-declared-with-a-lazy-reference 마이그레이션 파일과 데이터베이스를 지우..

문제상황 model을 설정해주기 위해서 클래스를 많이 만들고, 마이그레이션 하기 전에 일단 python manage.py runserver 8080 를 해줬는데 NameError가 뜬다. 같은 상황에서 마이그레이션을 진행해줘도 같은 에러가 뜬다. File "/home/ubuntu/projects/cvstore/managements/models.py", line 37, in class Sales_detail(models.Model): File "/home/ubuntu/projects/cvstore/managements/models.py", line 45, in Sales_detail events = models.ForeignKey(Event, on_delete=models.CASCADE) NameError..

점프투장고를 따라하다가 막힌 부분과 해결과정을 적어보았습니다. 점프투장고 https://wikidocs.net/book/4223 부트스트랩 반응형 웹의 햄버거버튼을 이용하였고 코드가 제대로 작동한다면 화면크기를 줄이면 햄버거 버튼이 나타나야 한다. 햄버거버튼을 클릭해도 아무런 변화가 없다. 그 이유는 부트스트랩 자바스크립트 파일(bootstrap.min.js)이 base.html 파일에 포함되지 않았기 때문이다. 또 부트스트랩 자바스크립트는 제이쿼리(jQuery)기반이므로 제이쿼리 자바스크립트 파일도 필요하다. 자바스크립트 파일과 제이쿼리 자바스크립트 파일 다운 받아 이용하는 방법 제이쿼리 다운로드 링크 들어가기: https://jquery.com/download/ Download the compress..

문제상황 큰 문제까지는 아니었고 마크다운을 설치하다가 pip 버전을 upgrade 하라는 메시지가 나왔다. WARNING: You are using pip version 20.0.2; however, version 20.1 is available. You should consider upgrading via the 'c:\venvs\mysite\scripts\python.exe -m pip install --upgrade pip' command. (mysite) c:\projects\mysite 가상환경에 있었는데 c:\venvs\mysite\scripts\python.exe 주소로 들어가서 업그레이드 명령어를 써야 하나 고민했었다. 해결과정 (mysite) c:\projects\mysit..

장고에서 myproject>templates>base.html의 body 부분에 네비게이션바를 작성하는 대신에 include 기능을 이용하는 방법 templates 디렉토리에 navbar.html 를 만든다. navbar.html에 네비게이션바에 해당하는 코드를 넣어준다. 부트스트랩에서 navbar 코드를 그대로 가져왔음 Navbar Home (current) Link Dropdown Action Another action Something else here Disabled Search base.html 태그와 태그 사이에 {% include "navbar.html" %}을 넣어준다. {% include "navbar.html" %} {% block content %} {% endblock %} incl..

template tag 정리 {% empty %} 가 무엇인지 알아보다가... (너무 쉬운건데 말이죠..) {% for comment in review.comment_set.all %} {{ comment.user }} {{ comment.content }} x {% empty %} No comment yet! {% endfor %} comment가 없을 경우 p태그를 출력합니다...? 공식문서도 함께 봐주기 https://docs.djangoproject.com/en/3.0/ref/templates/builtins/ django 공식문서 Built-in template tags and filters 아래 사이트에는 탬플릿 태그와 필터가 한국어로 잘 정리되어 있습니다. https://goodmorning..