FallMon 프로젝트의 Server 입니다.
SecretKey는 최상위 디렉토리의 secretes.json에 저장합니다.
{
"SECRET_KEY" : "YOUR DJANGO SECRET KEY",
"DATABASES" : {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "fallmon",
"USER": "<database user>",
"PASSWORD": "<password>",
"HOST": "localhost",
"PORT": "3306"
}
}
} use "initial_data.json" to initialize the fall types in the database
{
"FallType": ["drop attack", "non fall", "slipping", "stand push", "sunken floor", "fall"]
}install python packages and run migrations
pip install -r requirements.txt
python manage.py migratepython manage.py runserverdatabase (ex. mysql)
reverse proxy (ex. caddy)
example Caddyfile: located in /etc/caddy/Caddyfile
:8080 {
# Enable the static file server.
root * /home/ubuntu/FallMonserver/.static_roots
file_server
# Set up a reverse proxy:
reverse_proxy localhost:8000
}caddy rungit checkout deployinstall python packages and run migrations
pip install -r requirements.txt
python manage.py migratecollect static files
python manage.py collectstaticexport DJANGO_ENV=PROD
source .venv/bin/activate
gunicorn --bind 0.0.0.0:8080 FallMonServer.wsgi