목록Programing/Django (7)
스마트시대

Before push your code on Github, you should create the environment as above. When you upload the Django code to Git, you need to remove the secret code, but you have to remove the secret key and upload it separately. So I removed the venv folder or unnecessary files in Ignore. Install the pip packages make the config.env and put your secret key in the file Declare the secret key like this in set..

Make the base.html file for check the frontend part working. app_name specifies the name of the 'user' directory and writes the code as above. For rendering, writes the login funtion like above. (user-> views.py) 'DIRS' is the code specifing the directory of base.html. # base.html 홈 로그인 Make a navigation bar in the base.html temporarily. Since the red part is the content that changes continuousl..

user폴더를 생성하고 settings.py에서 'user',를 추가해준다. user/models.py에서 상단과 같이 입력해주고 Database에 model을 위한 테이블로 상단과 같이 명령어를 입력하고 관리자 페이지에서 'Registery'에 접근이 되는 것을 확인한다. 관리자 페이지에서 registery를 추가하기 위한 설정으로 상단과 같이 진행하여 관리자 페이지에서 add registery페이지로 이동되는 것을 확인한다.

Django admin 사이트 구축 https://tutorial.djangogirls.org/ko/django_admin/ Django 관리자 · HonKit 관리자 화면을 한국어로 변경하길 원할 경우 'settings.py'중 LANGUAGE_CODE = 'en-us'를 LANGUAGE_CODE = 'ko'로 바꾸세요. 방금 막 모델링 한 글들을 장고 관리자에서 추가하거나 수정, 삭제할 수 있어요. 이제 tutorial.djangogirls.org 해당 폴더에는 admin.py가 각각 있는데 이 py파일에 상단과 같이 입력해준다. 그리고 python manage.py runserver를 실행한다. 웹 브라우저에서 127.0.0.1:8000/admin으로 액세스를 하고 콘솔로 돌아와 python man..

Django model 구축 https://tutorial.djangogirls.org/ko/django_models/ Django 모델 · HonKit 이번에는 블로그 내 모든 포스트를 저장하는 부분을 만들 거에요. 먼저 우리는 객체(object)에 대해서 조금 알고 있어야 해요. 프로그래밍 개발 방법 중에는 객체 지향 프로그래밍(object oriented progr tutorial.djangogirls.org python manage.py startapp app 으로 어플리케이션을 생성한다. 애플리케이션을 생성하면 Django에 해당 어플을 사용한다고 알려줄 필요가 있다. ticketsite/settings.py에서 상단 항목을 찾아 'app',을 추가해준다. 다시 app/model.py 로 돌아와..

Django 프로젝트 시작하기 https://tutorial.djangogirls.org/ko/django_start_project/ 나의 첫 번째 Django 프로젝트! · HonKit 맥 OS과 리눅스 콘솔에서는 다음과 같이 명령을 실행해야해요. 명령어 끝에 .(점, 마침표)을 입력하는 것을 잊지마세요. : command-line (myvenv) ~/djangogirls$ django-admin startproject mysite . 점 .은 현재 디렉 tutorial.djangogirls.org django-admin startproject ticketsite . 으로 프로젝트를 생성해주면 상단과 같은 ticketsite폴더와 manage.py이 생성된다. https://tutorial.django..

https://tutorial.djangogirls.org/ko/installation/ 설치하기 · HonKit Git은 git-scm.com에서 내려받을 수 있습니다. 설치는 쉽답니다. 딱 한 단계만 빼고 기본 설정대로 다음 다음 다음을 계속 눌러주면 쉽게 설치할 수 있어요. 다섯 번째 PATH 환경 설정(Adjusting your PATH en tutorial.djangogirls.org python - venv venv venv/Scripts/activate where python - 바탕화면에 local(웹서버 구축을 위한 코드들의 모음집)이라는 폴더를 생성하고 해당 폴더로 이동해 source venv/bin/activate로 가상환경을 실행시켜준다. ※윈도우 환경에서는 venv/bin/acti..