Skip to content

Commit

Permalink
Improvements to project host stability.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed Jun 24, 2024
1 parent 0718b5c commit a8aa666
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions myproject/auth/services/authservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import logging

from django.apps import apps
from django.conf import settings
from django.contrib.auth import authenticate, login, logout, get_user_model
from django.urls import reverse
Expand All @@ -31,7 +30,7 @@ def process_register(request, user):
emailutils.send_multipart_email('email/register',
{
'PROJECT_NAME': settings.PROJECT_NAME,
'site_url': apps.get_app_config('common').PROJECT_HOST,
'site_url': settings.PROJECT_HOST,
'login_url': reverse('login'),
},
f'Welcome to {settings.PROJECT_NAME}', [user.email],
Expand Down Expand Up @@ -110,7 +109,7 @@ def process_forgot_password(request):
emailutils.send_multipart_email('email/forgot',
{
'password': password,
'site_url': apps.get_app_config('common').PROJECT_HOST,
'site_url': settings.PROJECT_HOST,
'settings_url': reverse('settings')
},
'Your Password Has Been Reset', [email])
Expand Down
3 changes: 0 additions & 3 deletions myproject/common/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class CommonConfig(AppConfig):
name = 'myproject.common'
verbose_name = 'Common'

PROJECT_HOST = settings.PROJECT_HOST

def ready(self):
if settings.USE_NGROK and os.environ.get("NGROK_AUTHTOKEN"):
# pyngrok will only be installed, and should only ever be initialized, in a dev environment
Expand All @@ -30,7 +28,6 @@ def ready(self):
print(f"ngrok tunnel \"{public_url}\" -> \"http://127.0.0.1:{port}\"")

# Update any base URLs or webhooks to use the public ngrok URL
self.PROJECT_HOST = public_url
CommonConfig.init_webhooks(public_url)

@staticmethod
Expand Down

0 comments on commit a8aa666

Please sign in to comment.