DEV Community

sa3i0l
sa3i0l

Posted on

deploy django on Render

(to make it easier you just need to have these in your requirements.txt and pip install them as well ):

django
gunicorn
packaging
whitenoise

Enter fullscreen mode Exit fullscreen mode

Then to run server, guicorn is used for it:

gunicorn -w 4 <site_name>.wsgi:application
Enter fullscreen mode Exit fullscreen mode

<site_name> - is name of main folder in your project !

  • Add this in <site_name>/settings.py:
MIDDLEWARE = [
    'whitenoise.middleware.WhiteNoiseMiddleware',
    # ... all your other middleware
]
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'


... 

# and also set this as well. 
DEBUG = True
ALLOWED_HOSTS = ['*']


Enter fullscreen mode Exit fullscreen mode

Top comments (0)