π
twisted-iocpsupport λ λ‘컬 window νκ²½μμ ν μ€νΈ νλ©° λ°μμ§ κ²μΌλ‘
- twisted-iocp support
Windows "I/O completion Ports" APIμ λ°μΈλ©μ μ 곡νλ ν¨ν€μ§ μ΄λ€.
νμ¬ μ°λΆν¬ νκ²½μμ λ°°ν¬κΈ° requirements νμΌμ μλ λͺ©λ‘μ pip νλ μμ€ μλ¬κ° λ°μνμλ€.window μ μ© ν¨ν€μ§ μ΄λ―λ‘ λ¦¬λ μ€ νκ²½μμ λ°°ν¬ν λλ ν΄λΉ iocpsupportλ₯Ό μ§μμ€ ν λ°°ν¬λ₯Ό μ§ννλ©΄ λλ€.
π django channelsλ₯Ό λ°°ν¬νλ©° κ°μ₯ μ λ¨Ήμλ λΆλΆμΈλ° dockerμ μ΅μνμ§ μμ redis 컨ν μ΄λλ₯Ό λ°λ‘ λ§λ€μ΄μ£Όλλ° μ λ¨ΉμμΌλ©° λν 컨ν μ΄λ μ€νμλ§λ€ ipμ£Όμκ° λ°λμ΄
django settings.py νμΌμ channel layer config λΆλΆμ ipλ₯Ό ν λΉν΄ μ£Όλ λΆλΆμμ μ‘°κΈ μκ°μ΄ λ€μ΄κ°λ€.
μ§κΈμ static μΌλ‘ ipλ₯Ό λ£μ΄μ£Όμ΄ λ°κΏ νμκ° μμ΄μ‘λ€.
- django settings
CHANNEL_LAYERS = { "default": { "BACKEND": "channels_redis.core.RedisChannelLayer", "CONFIG": { "hosts": [("192.168.16.3", 6379)], }, }, }
- docker compose
redis: image: redis ports: - "6379:6379" networks: carrot: ipv4_address: 192.168.16.3 backend: container_name: backend build: ./backend/ command: sh -c "python manage.py collectstatic --no-input && python manage.py migrate && uvicorn Togeduck.asgi:application --host 0.0.0.0 --port 8000 --reload --ws websockets" volumes: - ./backend/django/:/app/ - /etc/localtime:/etc/localtime:ro - django_media:/app/media/ # nginxμμ mediaλ₯Ό μ¬μ©ν μ μλλ‘ volumeμ μ§μ ν΄μ€λλ€. - django_static:/app/static/ # nginxμμ staticμ μ¬μ©ν μ μλλ‘ volumeμ μ§μ ν΄μ€λλ€. environment: # djangoμμ μ¬μ©ν μ€μ λ€μ μ§μ ν΄μ€λλ€. - DEBUG=1 - POSTGRES_DB=django - POSTGRES_USER=user - POSTGRES_PASSWORD=P@ssw0rd - POSTGRES_HOST=postgres - POSTGRES_PORT=5432 depends_on: - postgres - redis links: - redis restart: always hostname: backend ports: - 8000:8000 networks: carrot: ipv4_address: 192.168.16.4 networks: carrot: driver: bridge ipam: driver: default config: - subnet: 192.168.16.0/16
uvicornμ λ¨μΌ νλ‘μΈμ€λ‘ asgi μ²λ¦¬κ° κ°λ₯νμ§λ§ κ²°κ΅ λ¨μΌ νλ‘μΈμ€λΌ νκ³κ° μμ΄ μ²λ¦¬λμ λλ¦¬λ €λ©΄ λ©ν° νλ‘μΈμ€λ₯Ό νμ©ν΄μΌ νλ€.
μΌλ¨μ aws μλ²κ° cpu μ½μ΄κ° νκ°μ¬μ uvicornμ μ¬μ©νμ§λ§ μΆ ν aws ν¬λλ§μ΄ μ±κ³΅νλ€λ©΄... daphneλ‘ λ©ν° νλ‘μΈμ€λ₯Ό νμ©νμ¬ asgi μ²λ¦¬κ° κ°λ₯ν μλ²λ₯Ό ꡬμΆν΄λ³΄λ €κ³ νλ€.