Skip to content

Commit

Permalink
Merge pull request #4180 from GeotrekCE/move_from_env_file_to_dotenv
Browse files Browse the repository at this point in the history
Move from `env_file` to `dotenv` (deprecated)
  • Loading branch information
Chatewgne authored Aug 20, 2024
2 parents 1d8b804 + 9b9f307 commit da69ed2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
7 changes: 6 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ CHANGELOG

**Documentation**

- Add authors, creators and last_author columns in displayed lists views and exports
- Add authors, creators and last_author columns in displayed lists views and exports

**Maintenance**

- Replace deprecated `env_file` with `dotenv`


2.109.0 (2024-08-08)
----------------------------
Expand Down
7 changes: 3 additions & 4 deletions geotrek/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import env_file
import os
import sys

from django.conf.global_settings import LANGUAGES as LANGUAGES_LIST
from django.contrib.gis.geos import fromstr
from django.contrib.messages import constants as messages
from django.conf.global_settings import LANGUAGES as LANGUAGES_LIST

from dotenv import load_dotenv
from easy_thumbnails.conf import Settings as easy_thumbnails_defaults

from geotrek import __version__
Expand Down Expand Up @@ -33,7 +32,7 @@ def api_bbox(bbox, buffer):

DOT_ENV_FILE = os.path.join(VAR_DIR, 'conf/env')
if os.path.exists(DOT_ENV_FILE):
env_file.load(path=DOT_ENV_FILE)
load_dotenv(DOT_ENV_FILE)

ALLOWED_HOSTS = os.getenv('SERVER_NAME', 'localhost').split(' ')
ALLOWED_HOSTS = ['*' if host == '_' else host for host in ALLOWED_HOSTS]
Expand Down
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ easy-thumbnails==2.8.5
# geotrek (setup.py)
# mapentity
# paperclip
env-file==2020.12.3
# via geotrek (setup.py)
filelock==3.15.4
# via django-large-image
fiona==1.9.4.post1
Expand Down Expand Up @@ -292,6 +290,8 @@ pyphen==0.11.0
# via weasyprint
python-dateutil==2.9.0.post0
# via celery
python-dotenv==1.0.0
# via geotrek (setup.py)
python-magic==0.4.27
# via paperclip
pytz==2023.3.post1
Expand Down Expand Up @@ -369,8 +369,6 @@ urllib3==2.2.2
# via
# requests
# sentry-sdk
values==2020.12.3
# via env-file
vine==5.1.0
# via
# amqp
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def run(self):
'chardet',
'cairosvg',
'cairocffi',
'env_file',
'python-dotenv',
# pinned by requirements.txt
'pymemcache',
'coreschema',
Expand Down

0 comments on commit da69ed2

Please sign in to comment.