- Nginx : Web server
- uWSGI : Connect web server and application server
- Django REST framework (v3.2) : Application server
- MySQL : Relational DB
- Redis : In-memory DB
- Celery : Async task manager
- Fabric : Deploy tool
- NPM : Package management
- Webpack : Manage static files and bundle modules
- SCSS : Stylesheet
- Bootstrap : Framework made by twitter
- django-simple-captcha : Human validation
- django-suit : Admin interface
- django-silk : Inspection tool
- REST framework JWT : JSON Web Token authentication
- List : admin only
- Create : anyone
- Retrieve : own self or admin
- Update : own self or admin
- Partial update : own self or admin
- Destroy : admin only
- List : anyone
- Create : logged in user
- Retrieve : anyone
- Update : own self only
- Partial update : own self only
- Destroy : admin only
- List : anyone
- Create : logged in user
- Retrieve : anyone
- Update : own self only
- Partial update : own self only
- Destroy : admin only
/var/www/mysite.com/ .gitignore manage.py fabfile.py robots.txt package.json conf/ nginx/ nginx.dev.conf nginx.prod.conf uwsgi/ mysite.ini uwsgi.conf pip/ requirements.txt sensitive-fake/ configuration.ini remote_server.pem logs/ mysite/ __init__.py urls.py wsgi.py apps/ main/ __init__.py admin.py models.py permissions.py seliarizers.py tests.py urls.py views.py utils/ __init__.py cron.py redis.py utilities.py settings/ __init__.py base.py dev.py prod.py templates/ base.html index.html 404.html 503.html static/ index.js webpack.config.js styles.scss bootstrap.config.js bootstrap.config.less module/ obtainAuthToken.js verifyAuthToken.js setAuthToken.js refreshAuthToken.js clearAuthToken.js
- Ubuntu basic settings
- Django basic settings
- NPM basic settings
- Webpack basic settings
- SCSS basic settings
$ mv django-rest-framework-example/ /var/www/{YOUR PROJECT NAME}.com/
$ cd /var/www/{YOUR PROJECT NAME}.com/
$ mv mysite/ {YOUR PROJECT NAME}/
- Let
{PROJECT PATH}
as/var/www/{YOUR PROJECT NAME}.com/
$ cd {PROJECT PATH}/conf/uwsgi/
$ mv mysite.ini {YOUR PROJECT NAME}.ini
$ vi {YOUR PROJECT NAME}.ini
:%s/mysite/{YOUR PROJECT NAME}/g
$ cd {PROJECT PATH}/conf/nginx/
$ vi nginx.dev.conf nginx.prod.conf
:%s/mysite/{YOUR PROJECT NAME}/g
- Edit value of
worker_processes
togrep processor /proc/cpuinfo | wc -l
- Edit value of
worker_connections
toulimit -n
- Commentify
Redirect HTTP to HTTPS
block if you will not use SSL - Commentify
Redirect www to non-www
block if you will not redirectwww
tonon-www
$ cd {PROJECT PATH}/
$ vi package.json [Edit input]
:%s/mysite/{YOUR PROJECT NAME}/g
$ cd {PROJECT PATH}/conf/
$ cp -R sensitive-data/ sensitive/
$ vi configuration.ini [Fill out variables]
$ vi remote_server.pem [Fill out public certificate of remote server]