Use internal ip for api in production
This commit is contained in:
Binary file not shown.
@@ -21,6 +21,8 @@ ALLOWED_EXTENSIONS = {'csv'}
|
||||
|
||||
user_csvs = {}
|
||||
|
||||
LETTERBOXD_API_URL = os.getenv('LETTERBOXD_API_URL')
|
||||
|
||||
|
||||
@lru_cache(maxsize=1000)
|
||||
def get_poster_url(movie_name, movie_year):
|
||||
@@ -180,7 +182,7 @@ def fetch_diary_from_username():
|
||||
user_id = str(uuid.uuid4())
|
||||
session['user_id'] = user_id
|
||||
|
||||
api_url = f"https://api.hugo-pierret.be/letterboxd/diary?username={username}"
|
||||
api_url = f"{LETTERBOXD_API_URL}/letterboxd/diary?username={username}"
|
||||
resp = requests.get(api_url)
|
||||
if resp.status_code != 200:
|
||||
return jsonify({'error': 'Failed to fetch diary from upstream API'}), 502
|
||||
|
||||
Reference in New Issue
Block a user