old_contents: from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError
  from django.contrib.auth.decorators import login_required
  from django.shortcuts import render_to_response, get_object_or_404
  from django.template import RequestContext, Context, loader
  from django.core.urlresolvers import reverse
  from django.core.files import File
  from django.contrib.auth.models import User
  from django.db.models import Q, Avg
  from django.core.paginator import Paginator
  from django.conf import settings
  from django.contrib.sites.models import Site
  from django.utils.translation import ugettext as _
  from django.utils.translation import ungettext, string_concat
  from django.core.exceptions import MultipleObjectsReturned
  
  if "mailer" in settings.INSTALLED_APPS:
      from mailer import send_mail
  else:
      from django.core.mail import send_mail
  
  # Python libraries
  import os, logging, simplejson
  from datetime import datetime, timedelta
  
  from account.utils import get_default_redirect
  from shoppleyuser.forms import MerchantSignupForm, CustomerSignupForm
  
  def merchant_signup(request, form_class=MerchantSignupForm,
  	template_name="shoppleyuser/signup.html", success_url=None):
  	if success_url is None:
  		success_url = get_default_redirect(request)
  	if request.method == "POST":
  		form = form_class(request.POST)
  		if form.is_valid():
  			username, password = form.save()
  			if settings.ACCOUNT_EMAIL_VERIFICATION:
  				return render_to_response("account/verification_sent.html", {
  					"email": form.cleaned_data["email"],
  				}, context_instance=RequestContext(request))
  			else:
  				user = authenticate(username=username, password=password)
  				auth_login(request, user)
  				request.user.message_set.create(
  					message=_("Successfully logged in as %(username)s.") % {
  						'username': user.username
  					})
  				return HttpResponseRedirect(success_url)
  	else:
  		form = form_class()
  	return render_to_response(template_name, {
  		"form": form,
  	}, context_instance=RequestContext(request))
  
  def customer_signup(request, form_class=CustomerSignupForm,
  	template_name="shoppleyuser/customer_signup.html", success_url=None):
  	if success_url is None:
  		success_url = get_default_redirect(request)
  	if request.method == "POST":
  		form = form_class(request.POST)
  		if form.is_valid():
  			username, password = form.save()
  			if settings.ACCOUNT_EMAIL_VERIFICATION:
  				return render_to_response("account/verification_sent.html", {
  					"email": form.cleaned_data["email"],
  				}, context_instance=RequestContext(request))
  			else:
  				user = authenticate(username=username, password=password)
  				auth_login(request, user)
  				request.user.message_set.create(
  					message=_("Successfully logged in as %(username)s.") % {
  						'username': user.username
  					})
  				return HttpResponseRedirect(success_url)
  	else:
  		form = form_class()
  	return render_to_response(template_name, {
  		"form": form,
  	}, context_instance=RequestContext(request))
  
  
new_contents: from django.http import HttpResponse, HttpResponseRedirect, HttpResponseServerError
  from django.contrib.auth.decorators import login_required
  from django.shortcuts import render_to_response, get_object_or_404
  from django.template import RequestContext, Context, loader
  from django.core.urlresolvers import reverse
  from django.core.files import File
  from django.contrib.auth.models import User
  from django.db.models import Q, Avg
  from django.core.paginator import Paginator
  from django.conf import settings
  from django.contrib.sites.models import Site
  from django.utils.translation import ugettext as _
  from django.utils.translation import ungettext, string_concat
  from django.core.exceptions import MultipleObjectsReturned
  from django.contrib.auth import authenticate
  from django.contrib.auth import login as auth_login
  
  if "mailer" in settings.INSTALLED_APPS:
      from mailer import send_mail
  else:
      from django.core.mail import send_mail
  
  # Python libraries
  import os, logging, simplejson
  from datetime import datetime, timedelta
  
  from account.utils import get_default_redirect
  from shoppleyuser.forms import MerchantSignupForm, CustomerSignupForm
  
  def merchant_signup(request, form_class=MerchantSignupForm,
  	template_name="shoppleyuser/signup.html", success_url=None):
  	if success_url is None:
  		success_url = get_default_redirect(request)
  	if request.method == "POST":
  		form = form_class(request.POST)
  		if form.is_valid():
  			username, password = form.save()
  			if settings.ACCOUNT_EMAIL_VERIFICATION:
  				return render_to_response("account/verification_sent.html", {
  					"email": form.cleaned_data["email"],
  				}, context_instance=RequestContext(request))
  			else:
  				user = authenticate(username=username, password=password)
  				auth_login(request, user)
  				request.user.message_set.create(
  					message=_("Successfully logged in as %(username)s.") % {
  						'username': user.username
  					})
  				return HttpResponseRedirect(success_url)
  	else:
  		form = form_class()
  	return render_to_response(template_name, {
  		"form": form,
  	}, context_instance=RequestContext(request))
  
  def customer_signup(request, form_class=CustomerSignupForm,
  	template_name="shoppleyuser/customer_signup.html", success_url=None):
  	if success_url is None:
  		success_url = get_default_redirect(request)
  	if request.method == "POST":
  		form = form_class(request.POST)
  		if form.is_valid():
  			username, password = form.save()
  			if settings.ACCOUNT_EMAIL_VERIFICATION:
  				return render_to_response("account/verification_sent.html", {
  					"email": form.cleaned_data["email"],
  				}, context_instance=RequestContext(request))
  			else:
  				user = authenticate(username=username, password=password)
  				auth_login(request, user)
  				request.user.message_set.create(
  					message=_("Successfully logged in as %(username)s.") % {
  						'username': user.username
  					})
  				return HttpResponseRedirect(success_url)
  	else:
  		form = form_class()
  	return render_to_response(template_name, {
  		"form": form,
  	}, context_instance=RequestContext(request))
  
  
subject: add auth_login and authenticate import