It is hard to say because you haven't posted any sample code, but python will give the global name 'variable' is not defined
statement when this variable is not defined in the current namespace.
If you are working directly from the tutorial, and the error is thrown in views.py
, my guess is that you forgot to import the model in this file.
Try:
from mttp.models import Genre
where mttp
is the name of your app. I just grabbed this from the tutorial site but you may or may not have it set up differently.