I have running on my windows pc a django app with following structure
this app also runs locally and works with this settings
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_mysql',
'users',
'posts',
'comments',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
# 'chango2.middelware.ProfileCompletionMiddelware',
]
libraries: {
'tags': 'tags',
}
ROOT_URLCONF = 'chango2.urls'
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR,'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
this app work as expected when its runned locally with python manage.py runserver
now i trying to deploy this app on a ec2 , i have configurated the security gropus to allow port 80 **and **8000 for inbound and outbound
on ec2 i run with
(env) ubuntu@ip-172-31-3-242:~$ gunicorn --bind 0.0.0.0:8000 chango2.wsgi:application
app starts listening on port 8000 got the first page but for other link
then i recive the
the only thing changed between prod and local was
ALLOWED_HOSTS = [my ec2 dns]
and DATABASES (but that its working)