# Path: lkdcourses/profiles/views.py
# class UserProfileUpdate(LoginRequiredMixin, UpdateView):
#     model = UserProfile
#     form_class = UserForm
#     template_name = 'profiles/user_profile.html'
#     success_url = reverse_lazy('profiles:profile_edit')
#     success_message = 'Profiliniz başarıyla düzenlendi.'
# 
#     def get_object(self):
#         return self.request.user
# 
#     def form_valid(self, form):
#         messages.success(self.request, self.success_message)
#         return super(UserProfileUpdate, self).form_valid(form)
# 
# class RegisterView(CreateView):
#     form_class = UserCreationForm
#     template_name = 'registration/register.html'
#     success_url = '/'
#     success_message = 'Kaydınız gerçekleştirildi. Lütfen giriş yapın.'
# 
#     def form_valid(self, form):
#         messages.success(self.request, self.success_message)
#         return super(RegisterView, self).form_valid(form)


from django.conf.urls import url
from .views import UserProfileUpdate, RegisterView
from __future__ import unicode_literals




urlpatterns = [
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url(r'^profile/$', UserProfileUpdate.as_view(), name='profile_edit'),

# Path: lkdcourses/profiles/views.py
# class UserProfileUpdate(LoginRequiredMixin, UpdateView):
#     model = UserProfile
#     form_class = UserForm
#     template_name = 'profiles/user_profile.html'
#     success_url = reverse_lazy('profiles:profile_edit')
#     success_message = 'Profiliniz başarıyla düzenlendi.'
# 
#     def get_object(self):
#         return self.request.user
# 
#     def form_valid(self, form):
#         messages.success(self.request, self.success_message)
#         return super(UserProfileUpdate, self).form_valid(form)
# 
# class RegisterView(CreateView):
#     form_class = UserCreationForm
#     template_name = 'registration/register.html'
#     success_url = '/'
#     success_message = 'Kaydınız gerçekleştirildi. Lütfen giriş yapın.'
# 
#     def form_valid(self, form):
#         messages.success(self.request, self.success_message)
#         return super(RegisterView, self).form_valid(form)


# Path: lkdcourses/profiles/urls.py
from django.conf.urls import url
from .views import UserProfileUpdate, RegisterView

from __future__ import unicode_literals




urlpatterns = [
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url(r'^profile/$', UserProfileUpdate.as_view(), name='profile_edit'),

]