# Path: munger_builder/forms.py
# class UserRegistrationForm(UserCreationForm):
# 
#     class Meta:
#         model = User
#         fields = ('username', 'email',)


from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext, loader
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from guardian.shortcuts import assign_perm
from .forms import UserRegistrationForm



def home_page(request):
    return render_to_response('home.html', RequestContext(request))
    # return HttpResponseRedirect('/script_builder/munger_builder_index/')

@login_required
def app_index(request):
    template = loader.get_template('app_index.html')
    context = RequestContext(request)
    return HttpResponse(template.render(context))


def register(request):
    context = RequestContext(request)

    if request.method == 'POST':


# Path: munger_builder/forms.py
# class UserRegistrationForm(UserCreationForm):
# 
#     class Meta:
#         model = User
#         fields = ('username', 'email',)


# Path: munger_builder/views.py
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext, loader
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from guardian.shortcuts import assign_perm
from .forms import UserRegistrationForm




def home_page(request):
    return render_to_response('home.html', RequestContext(request))
    # return HttpResponseRedirect('/script_builder/munger_builder_index/')

@login_required
def app_index(request):
    template = loader.get_template('app_index.html')
    context = RequestContext(request)
    return HttpResponse(template.render(context))


def register(request):
    context = RequestContext(request)

    if request.method == 'POST':


        user_form = UserRegistrationForm(data=request.POST)