update prints to log
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
from django.db import models
|
||||
from django.utils.text import slugify
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
from account.models import User
|
||||
from django.urls import reverse
|
||||
import requests
|
||||
@@ -148,7 +151,7 @@ class DollorModel(models.Model):
|
||||
data = response.json()
|
||||
price = int(data["lastTradePrice"])
|
||||
price_in_usd = price / 10.0
|
||||
print('\n\nprice from api \n\n')
|
||||
logger.info('Price fetched from API')
|
||||
except Exception as e:
|
||||
return self.defualt_price
|
||||
|
||||
|
||||
Reference in New Issue
Block a user