Django Deployment

Ubuntu+Django+gunicorn

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04

Ubuntu+Django+Uwsgi

https://www.eastnotes.com/post/29

添加用户和用户组:

useradd -m /home/zhoudj zhoudj
usermod -g www-data zhoudj

Troubleshooting:

Q:OperationalError at /admin/ attempt to write a readonly database

A: chown {user}:{user} db.sqlite3

https://www.digitalocean.com/community/questions/django-can-t-get-access-to-sqlite3-database

Q:Django admin无法加载css
A:STATIC_ROOT 我是直接写绝对地址,nginx配置中取消localtion /static

Allowed_hosts= ['.buiku.com', 'localhost', '127.0.0.1']

你可能感兴趣的:(Django Deployment)