Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bakerydemo/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import dotenv
from django.core.wsgi import get_wsgi_application

dotenv.read_dotenv(os.path.join(os.path.dirname(os.path.dirname(__file__)), ".env"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://github.com/theskumar/python-dotenv

By default, load_dotenv() will:

  • Look for a .env file in the same directory as the Python script (or higher up the directory tree).

So I think we're fine without explicitly resolving to the .env file.

dotenv.load_dotenv()

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bakerydemo.settings.dev")

Expand Down
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import dotenv

if __name__ == "__main__":
dotenv.read_dotenv()
dotenv.load_dotenv()

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bakerydemo.settings.dev")

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Make a pull request to https://github.com/wagtail/bakerydemo

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.
Additionally, various settings can be controlled through environment variables. The [python-dotenv](https://github.com/theskumar/python-dotenv) package is used to load these variables from a `.env` file in the project root.

### Note on demo search

Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Django>=6.0,<6.1
django-dotenv==1.4.2
python-dotenv==1.2.1
wagtail>=7.2,<7.3
wagtail-font-awesome-svg>=1,<2
django-debug-toolbar>=4.2,<5
Expand Down
2 changes: 1 addition & 1 deletion vagrant/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ chmod a+x $PROJECT_DIR/manage.py

# copy local settings file
cp $PROJECT_DIR/bakerydemo/settings/local.py.example $PROJECT_DIR/bakerydemo/settings/local.py
# add .env file for django-dotenv environment variable definitions
# add .env file for python-dotenv environment variable definitions
echo DJANGO_SETTINGS_MODULE=$PROJECT_NAME.settings.dev > $PROJECT_DIR/.env

if [ -n "$USE_POSTGRESQL" ]
Expand Down