Update generator.py

Making sure to have the proper request when working with class instances in sitemaps. In other case, vars in request.session behave erratic when working with several sites.