def user_register(request): dmb = DetectMobileBrowser() isMble = dmb.process_request(request) content = {'page': 'user_register', 'page_title': '注册为新会员'} print isMble if isMble: return render(request, 'basedatas/m_user_register.html', content) else: return render(request, 'basedatas/user_register.html', content)
def user_register(request): StatComm.count_page_traffic(request) dmb = DetectMobileBrowser() isMble = dmb.process_request(request) content = {'page': 'user_register', 'page_title': '注册为新会员'} if isMble: return render(request, 'basedatas/m_user_register.html', content) else: return render(request, 'basedatas/user_register.html', content)
from email.message import Message from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart from email.MIMEText import MIMEText from basedatas.e_mail import Email, EmailEx from django.conf import settings from django.db.models import Q import re from .form import BlockForm from .models import Block from mobile.detectmobilebrowsermiddleware import DetectMobileBrowser dmb = DetectMobileBrowser() def newblock(request): isMobile = dmb.process_request(request) if request.user.is_anonymous(): return comm.redirect_login_path(isMobile, request) user = request.user perm = user.has_perm('blocks.block_management') if request.method == 'POST': form = BlockForm(request.POST) if form.is_valid(): newblock = form.save(commit=False)