# Path: hubcave/userprofile/views.py
# class ProfileDetail(DetailView):
#     model = User
# 
#     def dispatch(self, request, *args, **kwargs):
#         return super(ProfileDetail, self).dispatch(request, *args, **kwargs)
# 
#     def get_template_names(self):
#         return ['userprofile/profile_detail.html']
# 
#     def get_context_data(self, **kwargs):
#         # Call the base implementation first to get a context
#         context = super(ProfileDetail, self).get_context_data(**kwargs)
#         context['users_games'] = Game.objects.filter(user=self.object)
#         profile = UserProfile.objects.get_or_create(user=self.object)
#         return context


from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from hubcave.userprofile.views import ProfileDetail


urlpatterns = patterns(
    '',
    url(r'^profile/(?P<pk>\w+)/$',

# Path: hubcave/userprofile/views.py
# class ProfileDetail(DetailView):
#     model = User
# 
#     def dispatch(self, request, *args, **kwargs):
#         return super(ProfileDetail, self).dispatch(request, *args, **kwargs)
# 
#     def get_template_names(self):
#         return ['userprofile/profile_detail.html']
# 
#     def get_context_data(self, **kwargs):
#         # Call the base implementation first to get a context
#         context = super(ProfileDetail, self).get_context_data(**kwargs)
#         context['users_games'] = Game.objects.filter(user=self.object)
#         profile = UserProfile.objects.get_or_create(user=self.object)
#         return context


# Path: hubcave/userprofile/urls.py
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from hubcave.userprofile.views import ProfileDetail



urlpatterns = patterns(
    '',
    url(r'^profile/(?P<pk>\w+)/$',

        login_required(ProfileDetail.as_view(), login_url='/'),