Python Django 37

[django 실습] 게시판 만들기 - model, admin 설정

python django 게시판 만들기 - model, admin 설정 python django를 이용한 게시판 만들기 시작 word count 실습을 끝낸 상태에서 시작 하겠습니다. mtv 패턴에서 드디어 m인 model 등장 vscode 설치하기 : https://integer-ji.tistory.com/65 python 설치하기 : https://integer-ji.tistory.com/64 git 설치하기 : https://integer-ji.tistory.com/66 vscode 설정하기 : https://integer-ji.tistory.com/81 hello world 띄우기 : https://integer-ji.tistory.com/82 git 초기 설정 : https://integer-j..

ascii code로 암호화 해주는 사이트

[django] ascii code로 암호화 해주는 사이트 word count를 진행하며 재미있을 거 같은 기능이 생각났다. 문자열을 ascii code로 암호화 하여 바꿀 수 있다면?? 친구들한테 장난치기 딱 좋을 거 같아 만들어 보기로 하였다. 기본 진행은 hello world 띄우기 -> page 이동 -> word count 실습 이후로 진행하겠습니다. -----------------------------------------------------------------------------------------------------------------------------------vscode 설치하기 : https://integer-ji.tistory.com/65 python 설치하기 : ht..

휴지통 2020.02.16

[django] 실습 Word Count 만들기 ( 1 )

python django 단어 수를 체크하는 Word Count 만들기 문자열을 입력받아 해당 단어를 체크하고 카운트하는 Word Count 실습입니다. vscode 설치하기 : https://integer-ji.tistory.com/65 python 설치하기 : https://integer-ji.tistory.com/64 git 설치하기 : https://integer-ji.tistory.com/66 vscode 설정하기 : https://integer-ji.tistory.com/81 hello world 띄우기 : https://integer-ji.tistory.com/82 git 초기 설정 : https://integer-ji.tistory.com/83 page 이동 : https://integer..

[django 기초] 페이지 이동, git push, 템플릿 태그

[django 기초] 페이지 이동, git push, 템플릿 태그 vscode 설치하기 : https://integer-ji.tistory.com/65 python 설치하기 : https://integer-ji.tistory.com/64 git 설치하기 : https://integer-ji.tistory.com/66 vscode 설정하기 : https://integer-ji.tistory.com/81 hello world 띄우기 : https://integer-ji.tistory.com/82 git 초기 설정 : https://integer-ji.tistory.com/83 새로운 페이지.html 생성 new page! 새로운 페이지 new.html을 템플릿 폴더 아래에 생성 views.py 등록 def ..

[django 기초] vscode git 초기 설정, git push, git 강제 push

[django 기초] vscode git 초기 설정, git push, git 강제 push vscode 설치하기 : https://integer-ji.tistory.com/65 python 설치하기 : https://integer-ji.tistory.com/64 git 설치하기 : https://integer-ji.tistory.com/66 vscode 설정하기 : https://integer-ji.tistory.com/81 hello world 띄우기 : https://integer-ji.tistory.com/82 ▶▶ .gitignore 들기 전에 필수 ◀◀ .gitignore 설정하기 : https://integer-ji.tistory.com/179 django secret key 분리하기 : h..

[django 기초] project 생성, app 생성, hello world 띄우기, MTV 패턴

[django 기초] project 생성, app 생성, hello world 띄우기 vscode 설치하기 : https://integer-ji.tistory.com/65 python 설치하기 : https://integer-ji.tistory.com/64 git 설치하기 : https://integer-ji.tistory.com/66 vscode 설정하기 : https://integer-ji.tistory.com/81 Django를 이용해 project 만들기 django-admin startproject crudproject pip 업그레이드가 완료되었다면 django-admin을 이용해 project를 만들어 줍니다. crudproject라는 이름의 프로젝트를 만들어 주었는데 이 또한 마찬가지로 p..

[django 기초] vscode 설정, git bash, django 설치, venv 생성

[django 기초] vscode 설정, git bash, django 설치, venv 생성 예전에 진행했던 django를 이용한 CRUD를 리뉴얼하고 궁금했던 거 공부하는 식으로 적어보기 vscode 설치하기 : https://integer-ji.tistory.com/65 python 설치하기 : https://integer-ji.tistory.com/64 git 설치하기 : https://integer-ji.tistory.com/66 vscode 실행 Terminal Default 설정 ctrl + shift + p -> Terminal: Select Default Shell -> Git Bash Git Bash를 사용할 것이니 Git Bash ctrl + shift + `(물결) -> bash 터미..

python django heroku 배포하기

1. Settings.py 수정하기 보안과 외부 접속 설정을 위하여 SECRET_KEY와 DEBUG, ALLOWED_HOSTS를 수정해야 합니다. SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', '기존의 시크릿키') DEBUG = bool( os.environ.get('DJANGO_DEBUG', True) ) ALLOWED_HOSTS = ['*'] 2. .gitignore파일 만들기 github에 올리기 전에 올리면 안 되는 내용을 필터링해줍니다.. gitignore파일을 manage.py파일과 같은 위치에 만들어주어야 합니다. ### Django ### *.log *.pot *.pyc __pycache__/ local_settings.py db.sqlite3 me..

KKU likelion django project (8)

이번 강의에서는 검색 기능을 만들어 보겠습니다. 검색어를 받기 위하여 home.html에 search form을 만들어 줍시다. 이제 검색어를 받고 필터링한 글목록을 보여줄 search.html을 만들어주어 home.html의 내용을 모두 복사하여 넣어줍니다. postapp/templates/search.html의 내용은 home.html과 동일합니다. 이제 필터링을 해줄 함수와 url을 설정합니다. views.py로 돌아와 def search(request): posts = Post.objects.all() q = request.GET.get('q', '') if q: posts = posts.filter(title__icontains=q) return render(request, 'search.htm..

KKU likelion django project (7)

게시글 삭제가 완료되었다면 댓글 삭제기능을 만들어 보겠습니다. @login_required def comment_delete(request, post_pk, pk): post = get_object_or_404(Post, pk=post_pk) comment = get_object_or_404(Comment, pk=pk) user = request.user.get_username() context = {'post': post,} content = request.POST.get('content') if user == comment.comment_writer: comment.delete() return redirect('detail', post_pk) else: messages.info(request, '아이..