2

I am trying to setup my Django Cookiecutter code on an Ubuntu server hosted on Digital Ocean. (My first attempt at such a thing.)

It does not appear that my .env file is loading?

DATABASE_URL=postgres://myapp:pwd123@127.0.0.1:5432/myapp
DJANGO_ALLOWED_HOSTS=187.99.73.187,myapp.com,187.99.73.187:8000
DJANGO_ADMIN_URL=admin
DJANGO_SETTINGS_MODULE=config.settings.production
DJANGO_SECRET_KEY=A8fpfkN5}...m5~^jggSo3wq`0Z*

I am using the latest version of Cookiecutter. https://github.com/pydanny/cookiecutter-django

Do I have to do something special to activate/recognize this code?

Right now I am getting an error of add '187.99.73.187' to ALLOWED_HOSTS. But it is in the env file.

I also had Postgres error based on not getting data from this new .env file.

I see instructions and videos for setting up Cookiecutter on Docker, Heroku and PythonAnywhere. Just not for a simple Linux installation.

Thanks.

diogenes
  • 1,865
  • 3
  • 24
  • 51
  • I have not worked on digital ocean(so can't suggest how), but have you set server environment's `DJANGO_READ_DOT_ENV_FILE` value to `True`. Else it will not read the `.env` file in project root – ruddra Apr 09 '19 at 05:10
  • ok, let me check. I was just about to give up and resort to Upwork. Thanks! – diogenes Apr 09 '19 at 05:18
  • DO is just Ubuntu. Also having issues with the gunicorn because the WSGI file is moved. a much higher degree of difficulty than I expected. – diogenes Apr 09 '19 at 05:26

0 Answers0