To install basic django project with postgresql, nginx and gunicorn you should simple run the script setup.sh.
$ git clone https://github.com/maxchv/deploy-django-project
$ cd deploy-django-project
$ . setup.sh
Enter valid path to git repository: https://github.com/maxchv/DemoDjangoProjectBy default superuser has username admin and password admin
By default database has user dbuser with password django and he has own database djangodb.
Your project should has the file requirements.txt with all requirements.
You need to set STATIC_ROOT contstan in settings.py to '/var/www/html/static':
STATIC_ROOT = '/var/www/html/static'Also you need to setup database configuration for postgres:
DATABASES= {
'default' : {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'djangodb',
'USER': 'dbuser',
'PASSWORD': 'django',
'HOST': 'localhost',
'PORT': ''
}
}And constant ALLOWED_HOSTS set to allow access from any hosts:
ALLOWED_HOSTS = ['*']It is very important to turn of debug mode:
DEBUG = False