Skip to content

Commit

Permalink
chore: upgrade Django
Browse files Browse the repository at this point in the history
  • Loading branch information
WheresAlice authored and wheresalice committed Jan 7, 2022
1 parent 1df7ef4 commit efb7189
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion imok/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,12 @@

# Use environment variables for the database in Dokku, and use whitenoise and prod settings
if 'DATABASE_URL' in env:
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', 'localhost').split(',')
hosts = os.environ.get('ALLOWED_HOSTS', 'localhost').split(',')
ALLOWED_HOSTS = hosts
ALLOWED_HOSTS.append(socket.getaddrinfo(socket.gethostname(), 'http')[0][4][0])
CSRF_TRUSTED_ORIGINS = []
for host in hosts:
CSRF_TRUSTED_ORIGINS.append(f"https://{host}")
DATABASES["default"] = env.db("DATABASE_URL") # noqa F405
DATABASES["default"]["ATOMIC_REQUESTS"] = True # noqa F405
DATABASES["default"]["CONN_MAX_AGE"] = env.int("CONN_MAX_AGE", default=60) # noqa F405
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django>=3.0,<4.0
Django>=4.0,<5.0
psycopg2-binary>=2.8
django-phonenumber-field[phonenumberslite]
twilio
Expand Down

0 comments on commit efb7189

Please sign in to comment.