본문 바로가기

장고5

[ Django ] 기타 설정 Then we need to update our static settings so it will be used in production. In your text editor open settings.py. Add whitenoise to the INSTALLED_APPS above the builtin staticfiles app and also to MIDDLEWARE on the third line. Order matters for both INSTALLED_APPS and MIDDLEWARE. At the bottom of the file add new lines for both STATIC_ROOT and STATICFILES_STORAGE. It should look like the follow.. 2023. 5. 3.
[ Django ] 내장 인증 새 프로젝트를 만들 때마다 기본적으로 Django는 다음을 포함하는 User 객체를 제공하는 auth 앱을 설치합니다 . username password email first_name last_name 이 User 개체를 사용하여 블로그 애플리케이션에서 log in, log out, sign up 을 구현합니다. 준비 작업 1. (default)저장 폴더 생성 - 반드시 이 위치에 생성 templates/registration 2. config/settings.py 에 Login, Logout redirect url 지정 LOGIN_REDIRECT_URL = 'home' LOGOUT_REDIRECT_URL = 'home' 3. 사용 base.html - 로그인 상태에 따른 상태 표시 project / t.. 2023. 5. 3.
[ Django ] django Views 1. Django 준비 작업 - app등록 대상파일 : projects /mysite / config / setting.py INSTALLED_APPS = [ "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", # Local App "pybo.apps.PyboConfig", ] - 관리자 모드에 Article 모듈 등록 대상파일 : projects /mysite / config / apps.py from django.contrib import admin from .mod.. 2023. 5. 2.
[ Django ] Index 1. Django 설치 2. app 설치 3. views 2023. 5. 2.
App생성 출처 : https://wikidocs.net/70649 2-01 URL과 뷰 * `[완성 소스]` : [github.com/pahkey/jump2django/tree/2-01](https://github.com/pahkey/jump2django/tree/… wikidocs.net 작업 순서 1. startapp명령을 사용하여 폴더 및 관련 파일 생성 2. settings.py파일에 app 등록 3. views.py 정의 4. urls.py 정의 (project urls.py 및 app urls.py) 작업 내역 http://localhost:8000/pybo 페이지를 요청했을 때 "안녕하세요 pybo에 오신것을 환영합니다."라는 문자열을 출력하도록 만들어 보자. 게시판 App 생성 (pybo) (mys.. 2023. 4. 12.