Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FallMonServer

FallMon 프로젝트의 Server 입니다.

Secrets 관리

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"
    }
  }
} 

Initial data

use "initial_data.json" to initialize the fall types in the database

{
    "FallType": ["drop attack", "non fall", "slipping", "stand push", "sunken floor", "fall"]
}

Run server (DEV)

install requirements

install python packages and run migrations

pip install -r requirements.txt
python manage.py migrate

runserver

python manage.py runserver

Run server (PROD)

requirement: database

database (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 run

checkout to deploy branch

git checkout deploy

install python packages and run migrations

pip install -r requirements.txt
python manage.py migrate

collect static files

python manage.py collectstatic

runserver

export DJANGO_ENV=PROD
source .venv/bin/activate
gunicorn --bind 0.0.0.0:8080 FallMonServer.wsgi

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages