Skip to content

maxchv/deploy-django-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy deploy django project on AWS EC2

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/DemoDjangoProject

Screen record installation

Django admin

By default superuser has username admin and password admin

Database config

By default database has user dbuser with password django and he has own database djangodb.

Requirements for django project

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published