검색하기귀찮아서만든블로그

[개발] Django, Celery, Redis 시작 (1) 본문

개발/프레임워크

[개발] Django, Celery, Redis 시작 (1)

hellworld 2020. 7. 7. 21:59

# Django 설치

$ pip3 install django

# Celery 설치 (task)

$ pip3 install celery

# Redis 설치 (broker)

$ apt install redis-server

$ wget http://download.redis.io/redis-stable.tar.gz
$ tar xvzf redis-stable.tar.gz
$ cd redis-stable
$ make # 설치

# redis 실행 (옵션은 비동기 실행 redis.conf 에서 설정 가능)

$ redis-server --daemonize yes 

# 정상 동작 확인

$ redis-cli ping > PONG

# redis 서버 종료 방법

$ pkill redis-server

# 장고 프로젝트를 생성한다.

$ django-admin startproject mysite

# mysite 프로젝트 경로로 이동

$ cd mysite

# mysite 프로젝트 실행

$ python3 manage.py runserver > Performing system checks... > System check identified no issues (0 silenced). > You have unapplied migrations; your app may not work properly until they are applied. > Run 'python manage.py migrate' to apply them. > 7월 03, 2020 - 15:50:53 > Django version 3.0, using settings 'mysite.settings' > Starting development server at http://127.0.0.1:8000/ > Quit the server with CONTROL-C.