django / djangosnippets.org

The code that powers djangosnippets.org, it allows users to post and share useful "snippets" of code.

Home Page:https://djangosnippets.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Configuration error starting up docker development environment

daniboygg opened this issue · comments

After clone the repository and execute the commands about docker-compose mentioned in the documentation, an error is raised:

/usr/local/lib/python3.7/site-packages/whitenoise/base.py:115: UserWarning: No directory at: /code/assets/static/
  warnings.warn(u"No directory at: {}".format(root))
/usr/local/lib/python3.7/site-packages/whitenoise/base.py:115: UserWarning: No directory at: /code/assets/static/
  warnings.warn(u"No directory at: {}".format(root))
DEBUG 2021-06-05 02:58:37,102 base 9 139713166593016 Configuring Raven for host: None
INFO 2021-06-05 02:58:37,102 base 9 139713166593016 Raven is not configured (logging is disabled). Please see the documentation for more information.
DEBUG 2021-06-05 02:58:44,187 base 10 139713166593016 Configuring Raven for host: None
INFO 2021-06-05 02:58:44,187 base 10 139713166593016 Raven is not configured (logging is disabled). Please see the documentation for more information.

This seems to happen because of the configuration in docker-compose.yml is pointing to djangosnippets.settings.production. To launch in development this should be djangosnippets.settings.development.

It would be a good idea to make an environment file (.env) to externalize this values and configure it without touch source code and add this part to the documentation.

@danigayosog
I usually put the following settings in the environment file.

SECRET_KEY
DEBUG
ALLOWED_HOSTS


ENGINE
DB_NAME
POSTGRES_USER
POSTGRES_PASSWORD
DB_HOST
DB_PORT

There are more project specific env variables for elasticsearch and redis as well.