Hi,
I can deplyo Django with docker and python3 environment on render successfully, and alos can access my website (URL: https://englam-test2.onrender.com/). But I can not get staic file (css, js, imgs) from my website. How to configure static file and environment?
MIDDLEWARE = [
‘django.middleware.security.SecurityMiddleware’,
‘whitenoise.middleware.WhiteNoiseMiddleware’,
‘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’,
]
STATIC_HOST = “https://englam-test2.onrender.com”
STATIC_URL = STATIC_HOST + “/static/”
STATICFILES_DIRS = [BASE_DIR/‘static’,]
STATIC_ROOT = BASE_DIR / ‘staticfiles’
Advanced → Environment Variables
ALLOWED_HOSTS = *
DEBUG = 1