moved omdb key to settings file
This commit is contained in:
parent
56c8d74f99
commit
745afd9dbd
2 changed files with 5 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
|||
import os
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from movie_db.movie_db import MovieDB
|
||||
import requests
|
||||
|
||||
|
@ -8,8 +10,7 @@ from movie_db.serializers import MovieSerializer, MovieResultSerializer
|
|||
|
||||
class OMDb(MovieDB):
|
||||
def __init__(self):
|
||||
api_key = os.getenv("OMDB_API_KEY")
|
||||
self.api_key = f"{api_key}"
|
||||
self.api_key = settings.OMDB_API_KEY
|
||||
self.base_url = "https://www.omdbapi.com/?apikey=" + self.api_key
|
||||
super().__init__()
|
||||
|
||||
|
|
|
@ -126,6 +126,8 @@ USE_I18N = True
|
|||
|
||||
USE_TZ = True
|
||||
|
||||
OMDB_API_KEY = os.environ.get("OMDB_API_KEY")
|
||||
|
||||
# Django Rest Framework
|
||||
REST_FRAMEWORK = {
|
||||
"DEFAULT_AUTHENTICATION_CLASSES": [
|
||||
|
|
Loading…
Add table
Reference in a new issue