The Movie Database Support

Heyyy am trying to get different genres eg comedy, action from the API in the python view function but am not able to.
def home(request): #logic for types of movies movie = get_trending() random_movies = random.randrange(0,18) poster = movie['results'][random_movies] trending = movie['results'] top_rated = get_Toprated()

#action movies
action = get_genres(28)

#animation movies
anime = get_genres(16)

#comegy movies
comedy = get_genres(35)

#horror
horror = get_genres(27)

#documentary
documentary = get_genres(99)

#adventure
adventure = get_genres(12)

#fantasy
fantasy = get_genres(14)

#thrillers
thriller = get_genres(53)

#science fiction
fictions = get_genres(878)

return render(request,'home.html',{
    "poster":poster,
    "trending":trending,
    "action":action,
    "horror":horror,
    "comedy":comedy(int(id)),
    "fantasy":fantasy,
    "adventure":adventure,
    "thriller":thriller,
    "fictions":fictions,
    "TopRated":top_rated,
    "documentary":documentary,
    "anime":anime,
})

here is my code. I think the problem is the context manager but am not able to figure out what to add in order to retrieve the data

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login