일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 중량 관리
- uiload
- 재고 관리
- django erp
- pyside6
- 장고로 ERP
- pip 설치
- ERP
- 페이지 최적화
- django rank
- tensorflow
- orm 최적화
- django drf
- django role based
- pyside6 ui
- django
- 장고
- qwindows.dll
- qpa_plugin
- pip 오류
- query 최적화
- 파이썬
- channels
- django test
- optimization page
- Python
- QApplication
- test drive development
- Self ERP
- materialized
- Today
- Total
취미삼아 배우는 프로그래밍
장고 aws ec2 배포 메모 본문
한국어 설명
www.youtube.com/watch?v=oGQ1HteFYnQ&t=1233s
AWS 사용하기 :
WSL을 통한 우분투 접속
# WSL 진입
ssh -i <pem_path>.pem ubuntu@<AWS_EC2_IP>
# 이게 안되면
chmod 400 <pem_path>.pem
# 이거도 안되면
sudo ssh -i <pem_path>.pem ubuntu@<AWS_EC2_IP>
진입 후 필요한것 설치
sudo apt-get update
sudo apt-get install build-essential python3 python3-dev python3-pip python3-venv libpq-dev nginx
sudo apt-get update
sudo pip3 install --upgrade pip
퍼블릭 키 발급
ssh-keygen -t rsa
만든 키 여기있음
cat /home/ubuntu/.ssh/id_rsa.pub
# (깃헙에등록)
가상환경 만들기
# git clone > 진입
sudo apt-get install virtualenv
virtualenv -p python3 venv
# 가상환경 활성화
source venv/bin/activate
# pip 업그레이드
pip install --upgrade pip
pip install -r reuqirements.txt
# 메모:
# sudo apt-get install libpq-dev
# libpq-dev < 이거 없으면 postgresql에서 오류남(psycopg) 그치만 위에서 설치함
Nginx 설정 : 다른 블로그 글 무진장 많음
https://cjh5414.github.io/nginx/
Django에서 Gunicorn, Nginx 이용하기
Jihun's Development Blog
cjh5414.github.io
위에껀 구니콘 사용 예, 아무튼 지금은 uwsgi 사용
git pull하고 사이트 업데이트
# 가상환경으로 들어가서
uwsgi uwsgi.ini
# 후
sudo service nginx reload
# gunicorn은
# gunicorn 프로젝트명.wsgi:application
celery 사용 메뉴얼 정리잘된 곳 메모
gist.github.com/mau21mau/9371a95b7c14ddf7000c1827b7693801
Configure Celery + Supervisor With Django
Configure Celery + Supervisor With Django. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
realpython.com/asynchronous-tasks-with-django-and-celery/
Asynchronous Tasks With Django and Celery – Real Python
This tutorial shows how to integrate Celery and Django and create Periodic Tasks
realpython.com
* already listening 오류시
Supervisor on Debian Wheezy: another program is already listening on a port that one of our HTTP servers is configured to use
When I run service supervisor start I run into the following error: Starting supervisor: Error: Another program is already listening on a port that one of our HTTP servers is configured to use. S...
stackoverflow.com
내 설정경로
sudo vi /etc/supervisor/conf.d/config-celery.conf
사용법
# 이걸로 키고(최초 실행만 하면됨, 자동재시작 들어가있음)
sudo supervisord
# 이걸로 컨트롤 ** 설정의 program 이름과 맞출것
sudo supervisorctl start config_celery
sudo supervisorctl stop config_celery
sudo supervisorctl reload config_celery
sudo supervisorctl status config_celery
윈도우에서 개발시 celery 작동 안될 때
# pip install gevent
celery -A config worker -l info -P gevent
# -P > Pool 옵션임, solo로 해도 사용가능함
'코드 자가리뷰(장고)' 카테고리의 다른 글
장고 쿼리셋 최적화 예제 복기(django queryset optimization) (0) | 2020.09.04 |
---|---|
페이지 최적화 예제(django queryset optimization example) (0) | 2020.08.27 |
ORM코드 최적화가 필요하다. (0) | 2020.08.23 |
model.py에는 온갖 정성을 쏟아붓자. (0) | 2020.08.20 |
장고 테스트 코드 작성기 (0) | 2020.08.08 |