Skip to content

Commit

Permalink
Fix explanation of .env and local.py
Browse files Browse the repository at this point in the history
As of d7a607a both local.py and .env are initially empty, as the bakerydemo.settings.dev module is directly usable as DJANGO_SETTINGS_MODULE. Update the explanation in readme.md to reflect this.
  • Loading branch information
gasman committed Jun 13, 2024
1 parent 2ba19b0 commit 676f211
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ cd bakerydemo
pip install -r requirements/development.txt
```

Next, we'll set up our local environment variables. We use [django-dotenv](https://github.com/jpadilla/django-dotenv)
to help with this. It reads environment variables located in a file name `.env` in the top level directory of the project. The only variable we need to start is `DJANGO_SETTINGS_MODULE`:
Next, we need to create the files `.env` and `bakerydemo/settings/local.py`, which provide a place for local configuration settings that need to be kept outside of version control. No such settings are required for a standard installation, but warnings will be displayed if these files are not present:
```bash
cp bakerydemo/settings/local.py.example bakerydemo/settings/local.py
cp .env.example .env
Expand Down Expand Up @@ -194,6 +193,12 @@ Make a pull request to https://github.com/wagtail/bakerydemo

# Other notes

### Local configuration files

The `bakerydemo/settings/local.py` file can be used to store local Django settings such as database connection details that need to be kept outside of version control.

Additionally, various settings can be controlled through environment variables. The [django-dotenv](https://github.com/jpadilla/django-dotenv) package is used to load these variables from a `.env` file in the project root.

### Note on demo search

Because we can't (easily) use ElasticSearch for this demo, we use wagtail's native DB search.
Expand Down

0 comments on commit 676f211

Please sign in to comment.