본문 바로가기

분류 전체보기689

*아주중요 Django - HttpResponseRedirect(리다이렉트) # 첫번째 파일 challenges > views.py from django.shortcuts import render from django.http import HttpResponse, HttpResponseNotFound, HttpResponseRedirect monthly_challenges = { 'january':'Eat no meat for the entire month!', 'february': 'Walk for at least 20 minutes every day!', 'march': 'Learn Django for at least 20 minutes every day', 'april': 'Eat no meat for the entire month', 'may': 'Walk for at l.. 2022. 10. 7.
*매우중요 Django - 딕셔너리(dict)로 함수 간결화 하여서 views 호출하기 이번에도 파일은 3개다 하지만 특이 사항이 있다면, 두번째 파일의 에 대한 실질적 기능에 대한 다룸은 다음 강의에서 다룬다. 따라서 path만 있다고 가정하고 views.py (첫번째 파일)를 조작해 줬다고 보면 된다. # 첫번째 파일 challenges > views.py from django.shortcuts import render from django.http import HttpResponse, HttpResponseNotFound monthly_challenges = { 'january':'Eat no meat for the entire month!', 'february': 'Walk for at least 20 minutes every day!', 'march': 'Learn Django f.. 2022. 10. 7.
*매우중요 Django - views파일에서 하나의 함수로 다중 urls 호출하기 views를 호출해 주기 위해서 3군데를 건드려줄 필요가 있었다. # 첫번째 파일 challenges > views.py from django.shortcuts import render from django.http import HttpResponse, HttpResponseNotFound # Create your views here. def january(request): return HttpResponse('This is january') def february(request): return HttpResponse('This is february') def march(request): return HttpResponse('Learn Django for at least 20 minutes') def m.. 2022. 10. 7.
Python 가상환경 설정 링크 (env, venv) https://docs.python.org/3/tutorial/venv.html 12. Virtual Environments and Packages — Python 3.10.7 documentation 12.3. Managing Packages with pip You can install, upgrade, and remove packages using a program called pip. By default pip will install packages from the Python Package Index, . You can browse the Python Package Index by going to it in you docs.python.org 그동안에 계속 궁금했었는데, 일단 어떻게 가상환경으로써.. 2022. 10. 7.