BackEnd/Django

Django ํ”„๋กœ์ ํŠธ๋ฅผ uwsgi ํ”„๋กœํ† ์ฝœ์„ ์‚ฌ์šฉํ•ด์„œ ๋ฐฐํฌ๋ฅผ ํ•˜๊ณ , nginx์™€ ์—ฐ๋™ํ–ˆ๋”๋‹ˆ staticfile๋“ค์„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์—†์—ˆ๋‹ค. (404) ์ด์œ ๋Š” ๋ช‡ ๊ฐ€์ง€๊ฐ€ ์žˆ๋Š”๋ฐ.. 1. debug = False๋กœ ๋ฐฐํฌํ•˜๊ธฐ ๋•Œ๋ฌธ์— staticํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ์ž๋™์œผ๋กœ ๊ฐ€์ ธ์˜ค์ง€ ์•Š๋Š”๋‹ค. 2. uwsgiํ”„๋กœํ† ์ฝœ ์‚ฌ์šฉ์‹œ runserver๊ฐ€ ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— static ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ์ž๋™์œผ๋กœ ๊ฐ€์ ธ์˜ค์ง€ ์•Š๋Š”๋‹ค. ํ…Œ์ŠคํŠธ ํ•˜๋ฉด์„œ runserver๋ฅผ ํ†ตํ•ด ์„œ๋ฒ„๋ฅผ ๊ตฌ๋™ํ•˜๋ฉด static์„ ์ž˜ ๊ฐ€์ ธ์™”์„ํ…๋ฐ, ์‹ค์ œ ๋ฐฐํฌํ–ˆ๋”๋‹ˆ ๊ทธ๋ ‡์ง€ ์•Š์•˜๋‹ค. ๊ทธ๋ž˜์„œ nginx๋‹จ์—์„œ ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•˜๊ณ  ์ฒ˜๋ฆฌํ•˜๋„๋ก ํ–ˆ๋‹ค. /etc/nginx/nginx.conf http { ... server { ... location /static { alias /home/ec2-u..
ํ•œ์ฐฝ ์žฅ๊ณ ๋กœ ๊ฐœ๋ฐœ์„ ํ•˜๊ณ ๋‚˜๋ฉด runserver๋กœ ํ…Œ์ŠคํŠธ๋ฅผ ํ–ˆ์ง€๋งŒ, ์ง์ ‘ ๋ฐฐํฌ๋ฅผ runserver๋กœ ํ•˜๊ฒŒ๋˜๋ฉด ๋ณด์•ˆ, ์•ˆ์ •์„ฑ, ํšจ์œจ ๋“ฑ ์—ฌ๋Ÿฌ ๋ฉด์—์„œ ์ข‹์ง€์•Š๋‹ค.django.core.servers.basehttp """ HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21). Based on wsgiref.simple_server which is part of the standard library since 2.5. This is a simple server for use in testing or debugging Django apps. It hasn't been reviewed for security issues. DON'T USE I..
ddonghyeo
'BackEnd/Django' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก