When Deploying Django To Heroku: ModuleNotFoundError: No Module Named 'env'
When deploying Django to Heroku, I get a ModuleNotFoundError: No module named 'env' error. Anyone know why it is looking for that module? Here is my requirements.txt: asgiref==3.2.
Solution 1:
either remove the import env
code from the settings.py file and run this code
heroku config:set DISABLE_COLLECTSTATIC=1
Solution 2:
I remember how to get around this problem now. I needed to add to my settings file:
if os.path.exists('env.py'):
import env
Heroku is working again.
Thanks for your answers.
Post a Comment for "When Deploying Django To Heroku: ModuleNotFoundError: No Module Named 'env'"