# Path: apps/userstuff/models.py
# class UserProfile(models.Model):
#     user = models.ForeignKey(User, unique=True)
#     display_name = models.CharField(max_length=30)
#     current_salt = models.CharField(max_length=50)
# 
#     def __unicode__(self):
#         return self.user.username
# 
#     def username(self):
#         return self.user.username
# 
#     def get_wklejki(self):
#         return self.user.wklejka_set
# 
#     def generate_new_salt(self):
#         new_salt = generate_salt()
#         self.current_salt = new_salt
#         self.save()
#         return new_salt
# 
# Path: apps/wklej/xmlrpc.py
# def rpc_handler(request):
#     """
#     the actual handler:
#     if you setup your urls.py properly, all calls to the xml-rpc service
#     should be routed through here.
#     If post data is defined, it assumes it's XML-RPC and tries to process as
#     such Empty post assumes you're viewing from a browser and tells you about
#     the service.
#     """
# 
#     response = HttpResponse()
#     if len(request.POST):
#         response.write(dispatcher._marshaled_dispatch(request.raw_post_data))
#     else:
#         response.write("<b>This is an XML-RPC Service.</b><br>")
#         #methods = dispatcher.system_listMethods()
#     response['Content-length'] = str(len(response.content))
#     return response


from django.conf.urls import patterns, url, include
from django.conf import settings
from django.contrib import admin
from django.views.generic import RedirectView, TemplateView
from registration.views import RegistrationView
from apps.userstuff.models import UserProfile
from apps.wklej.xmlrpc import rpc_handler
        'django.contrib.auth.views.password_reset',
        {"template_name": 'registration/password_reset_form.html'},
        name="password_reset"),

    url(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
        'django.contrib.auth.views.password_reset_confirm',
        {'template_name': 'registration/password_reset_confirm.html'},
        name="password_reset_confirm"),

    url(r'^reset/done/$',
        'django.contrib.auth.views.password_reset_done',
        {"template_name": 'registration/password_reset_done.html'},
        name="password_reset_done"),

    url(r'^reset/complete/$',
        'django.contrib.auth.views.password_reset_complete',
        {"template_name": 'registration/password_reset_complete.html'},
        name="password_reset_complete"),

    url(r'^own/password/$', 'django.contrib.auth.views.password_change',
        {"template_name": 'registration/password_change_form.html'},
        name="password_change"),

    url(r'^own/password/done/$',
        'django.contrib.auth.views.password_change_done',
        {"template_name": 'registration/password_change_done.html'},
        name="password_change_done"),


    ## API:

# Path: apps/userstuff/models.py
# class UserProfile(models.Model):
#     user = models.ForeignKey(User, unique=True)
#     display_name = models.CharField(max_length=30)
#     current_salt = models.CharField(max_length=50)
# 
#     def __unicode__(self):
#         return self.user.username
# 
#     def username(self):
#         return self.user.username
# 
#     def get_wklejki(self):
#         return self.user.wklejka_set
# 
#     def generate_new_salt(self):
#         new_salt = generate_salt()
#         self.current_salt = new_salt
#         self.save()
#         return new_salt
# 
# Path: apps/wklej/xmlrpc.py
# def rpc_handler(request):
#     """
#     the actual handler:
#     if you setup your urls.py properly, all calls to the xml-rpc service
#     should be routed through here.
#     If post data is defined, it assumes it's XML-RPC and tries to process as
#     such Empty post assumes you're viewing from a browser and tells you about
#     the service.
#     """
# 
#     response = HttpResponse()
#     if len(request.POST):
#         response.write(dispatcher._marshaled_dispatch(request.raw_post_data))
#     else:
#         response.write("<b>This is an XML-RPC Service.</b><br>")
#         #methods = dispatcher.system_listMethods()
#     response['Content-length'] = str(len(response.content))
#     return response


# Path: urls.py
from django.conf.urls import patterns, url, include
from django.conf import settings
from django.contrib import admin
from django.views.generic import RedirectView, TemplateView
from registration.views import RegistrationView
from apps.userstuff.models import UserProfile
from apps.wklej.xmlrpc import rpc_handler

        'django.contrib.auth.views.password_reset',
        {"template_name": 'registration/password_reset_form.html'},
        name="password_reset"),

    url(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
        'django.contrib.auth.views.password_reset_confirm',
        {'template_name': 'registration/password_reset_confirm.html'},
        name="password_reset_confirm"),

    url(r'^reset/done/$',
        'django.contrib.auth.views.password_reset_done',
        {"template_name": 'registration/password_reset_done.html'},
        name="password_reset_done"),

    url(r'^reset/complete/$',
        'django.contrib.auth.views.password_reset_complete',
        {"template_name": 'registration/password_reset_complete.html'},
        name="password_reset_complete"),

    url(r'^own/password/$', 'django.contrib.auth.views.password_change',
        {"template_name": 'registration/password_change_form.html'},
        name="password_change"),

    url(r'^own/password/done/$',
        'django.contrib.auth.views.password_change_done',
        {"template_name": 'registration/password_change_done.html'},
        name="password_change_done"),


    ## API:

    (r'^xmlrpc/$', rpc_handler),