I'm working with Django and trying to generate jwt tokens in views.py and displaying it in html page. import jwt is throwing No module found error in views.py even though I have PyJwt installed already inside the virtual environment and it is working fine outside the views.py (say, jwttoken.py file)
views.py
import jwt
def generateJWT(portal):
key = 'secret'
payload = {'iat': time.time(),
'iss' : 'localhost',
'exp': int(time.time()) + (5*365*24 * 60),
'portal': portal}
#return payload
return jwt.encode(payload, key, algorithm="HS256")
Does it mean that I can't make use of jwt module in django? Is there any other way to make it work in Django as it is working outside?