# Path: userprofiles/settings.py
# class Settings(object):
#     def __init__(self, **kwargs):
#     def __getattr__(self, key):
# def validate_settings():


from django.contrib.auth import authenticate, login
from django.shortcuts import redirect
from django.views.generic import FormView, TemplateView
from userprofiles.settings import up_settings
from userprofiles.utils import get_form_class
# -*- coding: utf-8 -*-



class RegistrationView(FormView):
    form_class = get_form_class(up_settings.REGISTRATION_FORM)
    template_name = 'userprofiles/registration.html'

    def form_valid(self, form):
        form.save()
        username = form.cleaned_data['username']
        password = form.cleaned_data['password']

        # Automatically log this user in
        if up_settings.AUTO_LOGIN:

# Path: userprofiles/settings.py
# class Settings(object):
#     def __init__(self, **kwargs):
#     def __getattr__(self, key):
# def validate_settings():


# Path: userprofiles/views.py
from django.contrib.auth import authenticate, login
from django.shortcuts import redirect
from django.views.generic import FormView, TemplateView
from userprofiles.settings import up_settings
from userprofiles.utils import get_form_class

# -*- coding: utf-8 -*-



class RegistrationView(FormView):
    form_class = get_form_class(up_settings.REGISTRATION_FORM)
    template_name = 'userprofiles/registration.html'

    def form_valid(self, form):
        form.save()
        username = form.cleaned_data['username']
        password = form.cleaned_data['password']

        # Automatically log this user in
        if up_settings.AUTO_LOGIN:

            if up_settings.EMAIL_ONLY: