2024. 4. 26. 17:52
1. pip install django-cors-headers
2. settings.py
INSTALLED_APPS = [
'corsheaders'
]
3. MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
]
4. CORS_ALLOWED_ORIGINS = [
'http://localhost:5173' # 보내는 클라이언트 주소
]
5. CORS_ALLOW_CREDENTIALS = True
2024. 4. 26. 14:18
pip install djangorestframework
pip install djangorestframework-simplejwt
2024. 4. 26. 14:16
html 주소 대신 ssh 주소를 사용하면 된다
대신 keygen 으로 ssh 퍼블릭 키를 추가하면 된다
1. ssh key 생성
ssh-keygen -t rsa -b 4096 -C "exam@gmail.com"
2. id_rsa 파일과 id_rsa.pub 파일 생성 확인
3. github - settings - SSH and GPG Key - New ssh key -
id_rsa.pub 파일의 내용 복사 - 확인
4. .ssh 경로로 clone
2024. 4. 25. 10:52
AbstractUser 에서 관리자 계정 생성할 때 username 입력 에러 나서
username 항목에
null = True,
default = ' '
를 넣어주면 된다
2024. 4. 19. 14:27
1. gmail 로그인
2. 설정 - 보안 -
from django.core.mail import EmailMessage
email = EmailMessage('title', 'content', to=['apple@gmail.com'])
email.send()