Beispiel #1
0
def captcha(request):
    form = CaptchaForm()
    if request.POST:
        form = CaptchaForm(request.POST)
        if form.is_valid():
            request.session['passed_captcha'] = True
            return HttpResponseRedirect('/request-wizard/')
    return render_to_response('captcha.html', { 'form': form }, context_instance=RequestContext(request))
Beispiel #2
0
def home(request):
    if request.POST:
        form = CaptchaForm(request.POST)
        if form.is_valid():
            return HttpResponseRedirect(request.path + '?ok')
    else:
        form = CaptchaForm()

    return render(request, 'home.html', {'form': form})
Beispiel #3
0
def home(request):
    if request.POST:
        form = CaptchaForm(request.POST)
        if form.is_valid():
            return HttpResponseRedirect(request.path + "?ok")
    else:
        form = CaptchaForm()

    return render(request, "home.html", {"form": form})
Beispiel #4
0
def captcha(request):
    if request.POST:
        form = CaptchaForm(request.POST)
        if form.is_valid():
            return HttpResponseRedirect(request.path + '?ok')
    else:
        form = CaptchaForm()

    return render_to_response('home.html', dict(form=form),
                              context_instance=RequestContext(request))
Beispiel #5
0
def home(request):
    if request.POST:
        form = CaptchaForm(request.POST)
        if form.is_valid():
            return HttpResponseRedirect(request.path + '?ok')
    else:
        form = CaptchaForm()

    return render_to_response('home.html', dict(
        form=form
    ) , context_instance=RequestContext(request))
Beispiel #6
0
def home(request):

    advertisement_images_list = []
    advertisement_images = AdvertisementDetails.objects.all()
    for a in advertisement_images:
        ads_image = str(a.Ads_images)
        advertisement_images_list.append(ads_image)
    if request.POST:
        form = CaptchaForm(request.POST)
        if form.is_valid():
            print "ok"
    else:
        form = CaptchaForm()
    return render_to_response('home.html', dict(form=form),context_instance=RequestContext(request))
def login():
    form = SigninForm()
    form1 = CaptchaForm()

    if request.method == 'POST':
        if form1.validate_on_submit() == True:
            if form.validate() == False:
                return render_template('login.html', form=form, form1 = form1)
            else:
                session['nickname'] = form.nickname.data
                user = User.query.filter_by(nickname = session['nickname']).first()
                session['password'] = user.pwdhash
                return redirect(url_for('files'))
        else:
            flash(u'Wprowadź Captcha.')
            return render_template('login.html', form=form, form1 = form1)

    elif request.method == 'GET':
        return render_template('login.html', form=form, form1=form1)
Beispiel #8
0
def register_user(request):
    if not request.POST:
        return render(request,'register.html', {'user_creation_form' :UserCreationForm(),'captcha_form':CaptchaForm()})


    elif request.POST:

        user_creation_form = UserCreationForm(request.POST)
        captch_form = CaptchaForm(request.POST)
        if user_creation_form.is_valid():
            if captch_form.is_valid():

                new_user = user_creation_form.save()
                new_user.email =captch_form.cleaned_data['email']
                new_user.save()

            # log user in
                return redirect('/register_success/')

        # else if both forms are not valid
        return render(request,'register.html', {'user_creation_form' :user_creation_form,'captcha_form':captch_form})
Beispiel #9
0
def hello_world(name=None):
    if request.remote_addr in connections_dict:
        connections_dict[request.remote_addr][0] += 1
    else:
        connections_dict[request.remote_addr] = [1, 0]

    # if they've made more than 4 requests
    if connections_dict[request.remote_addr][0] >= 4:
        send_message(request.remote_addr, False)
        return render_template('robot.html', name=name)

    cpt = CaptchaForm()
    if request.method == "POST":
        if cpt.captcha.data == CAPTCHA_STRING:
            connections_dict.pop(request.remote_addr)
            send_message(request.remote_addr, True)
            return redirect("http://" + SERVER_IP)

    return render_template('index.html', name=name, form=cpt)
Beispiel #10
0
def signup_publisher_step2(request, term_id,advertiser_id=None):
    ''' Second step of publisher signup process'''
    from forms import PublisherSignupForm2,CaptchaForm
    from atrinsic.base.models import Organization,Terms_Accepted_Log,PublisherApplication
    advertiser = None
    print "404"
    if advertiser_id:
        advertiser = get_object_or_404(Organization, id=advertiser_id)

    if request.method == "POST":
        form = PublisherSignupForm2(False,request.POST)
        captcha_form = CaptchaForm(request.POST, initial={'captcha': request.META['REMOTE_ADDR']})
        if form.is_valid() and captcha_form.is_valid():
            print "TERMS__"
            z = Terms_Accepted_Log.objects.get(pk=term_id)
            import random
            import string
            u  =PublisherApplication.objects.create(first_name=form.cleaned_data['first_name'], last_name=form.cleaned_data['last_name'],
                                                    email=form.cleaned_data['email'],validation_code="".join([random.choice(string.letters+string.digits) for x in range(10)]))
            
            u.set_password(form.cleaned_data['password'])

            u.save()
            z.organization_id=u.id
            z.save()
            request.session['pub_app']=u.id
            from django.core.mail import EmailMultiAlternatives
            link = settings.SECURE_HOST + "/signup/publisher/step4/?id=%s&key=%s" % (u.id,u.validation_code)

            msg = EmailMultiAlternatives("Atrinsic Affiliate Network Email Confirmation", """
Thank you for your interest in the Atrinsic Affiliate Network.

To start your application process, click on the link below.  Our secure application will then open in a new browser window.

Once you've completed the remainder of the application, our team will review your site and information submitted.  If your application is subject to approval, a member of our Publisher Team will perform a phone verification with you in the next 24-48 hours.

Please add us to your white list to ensure all of our communications are received.
Complete the sign-up process on our website: %s

Thank you for your interest and we look forward to working with you.
The Atrinsic Affiliate Network Team
""" % link,"*****@*****.**",[u.email])

            msg.attach_alternative("""
Thank you for your interest in the Atrinsic Affiliate Network.<br/>
<br/>
To start your application process, click on the link below.  Our secure application will then open in a new browser window.<br/>
<br>
Once you've completed the remainder of the application, our team will review your site and information submitted.  If your application is subject to approval, a member of our Publisher Team will perform a phone verification with you in the next 24-48 hours.<br/>
<br/>
Please add us to your white list to ensure all of our communications are received.<br/>
Complete the sign-up process on our website <a href="%s">%s</a><br/>
<br/>
Thank you for your interest and we look forward to working with you.<br/>
The Atrinsic Affiliate Network Team<br/>"""% (link,link), "text/html")

            msg.send()

            if not advertiser_id:
                return HttpResponseRedirect("/signup/publisher/step3/")
            else:
                return HttpResponseRedirect("/signup/publisher/step3/%s/" % advertiser_id)
    else:
        form = PublisherSignupForm2()
        captcha_form = CaptchaForm()
    
    return AQ_render_to_response(request, 'signup/publisher_step2.html', {
            'advertiser' : advertiser,
            'form' : form,
            'captcha_form':captcha_form,
        }, context_instance=RequestContext(request))
Beispiel #11
0
def signup_advertiser(request):
    ''' View to handle the registration and signup for new Advertisers.  This view
        creates an AdvertiserApplication which can be used as a template for creating
        a new account by a Network Admin '''
    from forms import AdvertiserSignupForm,CaptchaForm
    from atrinsic.base.models import AdvertiserApplication
    if request.method == 'POST':
        form = AdvertiserSignupForm(request.POST)
        captcha_form = CaptchaForm(request.POST, initial={'captcha': request.META['REMOTE_ADDR']})

        if form.is_valid() and captcha_form.is_valid():
            if form.cleaned_data["country"] == "CA":
                form.cleaned_data["state"] = form.cleaned_data['province']
                
            del form.cleaned_data['province']
            adv = AdvertiserApplication.objects.create(**form.cleaned_data)
            
            from django.core.mail import EmailMultiAlternatives

            msg = EmailMultiAlternatives("Atrinsic Affiliate Network Advertiser Signup", """
Company Name: %s
Contact Name: %s %s
Email Address: %s
Website URL: %s

has submitted an application.
""" % (str(adv.organization_name),str(adv.contact_firstname[0:1].upper()+adv.contact_firstname[1:]),str(adv.contact_lastname[0:1].upper()+adv.contact_lastname[1:]), 
str(adv.contact_email),str(adv.website_url)),"*****@*****.**", ["*****@*****.**", "*****@*****.**", "*****@*****.**"])
            msg.send()

            # Send Advertiser Welcome Email
            msg = EmailMultiAlternatives("Thank you for  your interest in the Atrinsic Affiliate Network.", """
Prior to  launching as an advertiser, our sales team must evaluate your business' compatibility with our network. In order to do so, a member of the team will be in touch via email within the next 48 hours with some additional questions.

Please note that should your site not meet the basic criteria below, we will not be able to launch you on our affiliate network at this time.

    Site contains a secure shopping cart, a published return policy and guarantee, email communication confirming purchase and delivery of goods or services, and access to customer support
    Site contains no pop-ups on landing pages
    No template or blog sites
    Not a regional site that is only targeting a small market

How to know if you’re an Advertiser or Publisher?

    What is an advertiser?
    An advertiser, also known as a merchant or retailer, is a Web site or company that sells a product or service online, accepts payments and fulfills orders. Advertisers partner with publishers to help promote their products and services.<br /><br />
    What is a publisher?
    A publisher, also known as an affiliate or reseller, is an independent party  that promotes products and services of an advertiser in exchange for a  commission on leads or sales. A publisher displays an advertiser's ads, text  links, or product links on their Web site, in e-mail campaigns, or in search  listings. Signing up as a publisher is a free service.

If you have  completed the Advertiser sign-up form but are a better fit for a publisher  account, please contact client support at [email protected] and we will assist in the transition  of your application.

Regards – 
The Atrinsic  Affiliate Network Team

*Atrinsic Interactive is a full-service interactive agency. We are not just a vertical search agency, ad network or affiliate network. We offer a cross-platform approach to deliver customers to you in the most cost-efficient manner possible. We bring together individual experts and sophisticated business tools to drive significant results for our advertisers.

**Atrinsic is an integrated media company. We drive growing audiences from our content network and third party distribution channels to acquire high value customers for advertisers and our own products. Atrinsic is now one of the top digital performance marketing companies in the United States, which also provides exceptional entertainment content that draws 25 million unique visitors per month.""","*****@*****.**",[adv.contact_email])

            msg.attach_alternative("""
<p>Prior to  launching as an advertiser, our sales team must evaluate your business' compatibility with our network. In order to do so, a member of the team will be in touch via email within the next 48 hours with some additional questions.</p>
<p>Please note that should your site not meet the basic criteria below, we will not be able to launch you on our affiliate network at this time.</p>
<ul type="disc">
  <li>Site contains a secure shopping cart, a published return policy and guarantee, email communication confirming purchase and delivery of goods or services, and access to customer support</li>
  <li>Site contains no pop-ups on landing pages</li>
  <li>No template or blog sites</li>
  <li>Not a regional site that is only targeting a small market</li>
</ul>
<p>How to know if you’re an Advertiser or Publisher?<br /><br />
  What is an advertiser?<br />
  An advertiser, also known as a merchant or retailer, is a Web site or company that sells a product or service online, accepts payments and fulfills orders. Advertisers partner with publishers to help promote their products and services.<br /><br />
  What is a publisher?<br />
  A publisher, also known as an affiliate or reseller, is an independent party  that promotes products and services of an advertiser in exchange for a  commission on leads or sales. A publisher displays an advertiser's ads, text  links, or product links on their Web site, in e-mail campaigns, or in search  listings. Signing up as a publisher is a free service.<br /><br />
  If you have  completed the Advertiser sign-up form but are a better fit for a publisher  account, please contact client support at <a href="mailto:[email protected]">[email protected]</a> and we will assist in the transition  of your application.</p>
<p>Regards – <br />
  The Atrinsic  Affiliate Network Team</p>
<p>&nbsp;</p>
<p>*Atrinsic Interactive is a full-service interactive agency. We are not just a vertical search agency, ad network or affiliate network. We offer a cross-platform approach to deliver customers to you in the most cost-efficient manner possible. We bring together individual experts and sophisticated business tools to drive significant results for our advertisers.</p>
<p>**Atrinsic is an integrated media company. We drive growing audiences from our content network and third party distribution channels to acquire high value customers for advertisers and our own products. Atrinsic is now one of the top digital performance marketing companies<br />
  in the United States, which also provides exceptional entertainment content that draws 25 million unique visitors per month.</p>  
""", "text/html")
            msg.send()
            return AQ_render_to_response(request, 'signup/complete.html', { }, context_instance=RequestContext(request))
    else:
        form = AdvertiserSignupForm()
        captcha_form = CaptchaForm()

    return AQ_render_to_response(request, 'signup/advertiser.html', {
            'form' : form,
            'captcha_form' : captcha_form,
        }, context_instance=RequestContext(request))
Beispiel #12
0
def signup_publisher_step2(request, term_id, advertiser_id=None):
    ''' Second step of publisher signup process'''
    from forms import PublisherSignupForm2, CaptchaForm
    from atrinsic.base.models import Organization, Terms_Accepted_Log, PublisherApplication
    advertiser = None
    print "404"
    if advertiser_id:
        advertiser = get_object_or_404(Organization, id=advertiser_id)

    if request.method == "POST":
        form = PublisherSignupForm2(False, request.POST)
        captcha_form = CaptchaForm(
            request.POST, initial={'captcha': request.META['REMOTE_ADDR']})
        if form.is_valid() and captcha_form.is_valid():
            print "TERMS__"
            z = Terms_Accepted_Log.objects.get(pk=term_id)
            import random
            import string
            u = PublisherApplication.objects.create(
                first_name=form.cleaned_data['first_name'],
                last_name=form.cleaned_data['last_name'],
                email=form.cleaned_data['email'],
                validation_code="".join([
                    random.choice(string.letters + string.digits)
                    for x in range(10)
                ]))

            u.set_password(form.cleaned_data['password'])

            u.save()
            z.organization_id = u.id
            z.save()
            request.session['pub_app'] = u.id
            from django.core.mail import EmailMultiAlternatives
            link = settings.SECURE_HOST + "/signup/publisher/step4/?id=%s&key=%s" % (
                u.id, u.validation_code)

            msg = EmailMultiAlternatives(
                "Atrinsic Affiliate Network Email Confirmation", """
Thank you for your interest in the Atrinsic Affiliate Network.

To start your application process, click on the link below.  Our secure application will then open in a new browser window.

Once you've completed the remainder of the application, our team will review your site and information submitted.  If your application is subject to approval, a member of our Publisher Team will perform a phone verification with you in the next 24-48 hours.

Please add us to your white list to ensure all of our communications are received.
Complete the sign-up process on our website: %s

Thank you for your interest and we look forward to working with you.
The Atrinsic Affiliate Network Team
""" % link, "*****@*****.**", [u.email])

            msg.attach_alternative(
                """
Thank you for your interest in the Atrinsic Affiliate Network.<br/>
<br/>
To start your application process, click on the link below.  Our secure application will then open in a new browser window.<br/>
<br>
Once you've completed the remainder of the application, our team will review your site and information submitted.  If your application is subject to approval, a member of our Publisher Team will perform a phone verification with you in the next 24-48 hours.<br/>
<br/>
Please add us to your white list to ensure all of our communications are received.<br/>
Complete the sign-up process on our website <a href="%s">%s</a><br/>
<br/>
Thank you for your interest and we look forward to working with you.<br/>
The Atrinsic Affiliate Network Team<br/>""" % (link, link), "text/html")

            msg.send()

            if not advertiser_id:
                return HttpResponseRedirect("/signup/publisher/step3/")
            else:
                return HttpResponseRedirect("/signup/publisher/step3/%s/" %
                                            advertiser_id)
    else:
        form = PublisherSignupForm2()
        captcha_form = CaptchaForm()

    return AQ_render_to_response(request,
                                 'signup/publisher_step2.html', {
                                     'advertiser': advertiser,
                                     'form': form,
                                     'captcha_form': captcha_form,
                                 },
                                 context_instance=RequestContext(request))
Beispiel #13
0
def signup_advertiser(request):
    ''' View to handle the registration and signup for new Advertisers.  This view
        creates an AdvertiserApplication which can be used as a template for creating
        a new account by a Network Admin '''
    from forms import AdvertiserSignupForm, CaptchaForm
    from atrinsic.base.models import AdvertiserApplication
    if request.method == 'POST':
        form = AdvertiserSignupForm(request.POST)
        captcha_form = CaptchaForm(
            request.POST, initial={'captcha': request.META['REMOTE_ADDR']})

        if form.is_valid() and captcha_form.is_valid():
            if form.cleaned_data["country"] == "CA":
                form.cleaned_data["state"] = form.cleaned_data['province']

            del form.cleaned_data['province']
            adv = AdvertiserApplication.objects.create(**form.cleaned_data)

            from django.core.mail import EmailMultiAlternatives

            msg = EmailMultiAlternatives(
                "Atrinsic Affiliate Network Advertiser Signup", """
Company Name: %s
Contact Name: %s %s
Email Address: %s
Website URL: %s

has submitted an application.
""" % (str(adv.organization_name),
            str(adv.contact_firstname[0:1].upper() + adv.contact_firstname[1:]),
            str(adv.contact_lastname[0:1].upper() + adv.contact_lastname[1:]),
            str(adv.contact_email), str(adv.website_url)),
                "*****@*****.**", [
                    "*****@*****.**", "*****@*****.**",
                    "*****@*****.**"
                ])
            msg.send()

            # Send Advertiser Welcome Email
            msg = EmailMultiAlternatives(
                "Thank you for  your interest in the Atrinsic Affiliate Network.",
                """
Prior to  launching as an advertiser, our sales team must evaluate your business' compatibility with our network. In order to do so, a member of the team will be in touch via email within the next 48 hours with some additional questions.

Please note that should your site not meet the basic criteria below, we will not be able to launch you on our affiliate network at this time.

    Site contains a secure shopping cart, a published return policy and guarantee, email communication confirming purchase and delivery of goods or services, and access to customer support
    Site contains no pop-ups on landing pages
    No template or blog sites
    Not a regional site that is only targeting a small market

How to know if you’re an Advertiser or Publisher?

    What is an advertiser?
    An advertiser, also known as a merchant or retailer, is a Web site or company that sells a product or service online, accepts payments and fulfills orders. Advertisers partner with publishers to help promote their products and services.<br /><br />
    What is a publisher?
    A publisher, also known as an affiliate or reseller, is an independent party  that promotes products and services of an advertiser in exchange for a  commission on leads or sales. A publisher displays an advertiser's ads, text  links, or product links on their Web site, in e-mail campaigns, or in search  listings. Signing up as a publisher is a free service.

If you have  completed the Advertiser sign-up form but are a better fit for a publisher  account, please contact client support at [email protected] and we will assist in the transition  of your application.

Regards – 
The Atrinsic  Affiliate Network Team

*Atrinsic Interactive is a full-service interactive agency. We are not just a vertical search agency, ad network or affiliate network. We offer a cross-platform approach to deliver customers to you in the most cost-efficient manner possible. We bring together individual experts and sophisticated business tools to drive significant results for our advertisers.

**Atrinsic is an integrated media company. We drive growing audiences from our content network and third party distribution channels to acquire high value customers for advertisers and our own products. Atrinsic is now one of the top digital performance marketing companies in the United States, which also provides exceptional entertainment content that draws 25 million unique visitors per month.""",
                "*****@*****.**", [adv.contact_email])

            msg.attach_alternative(
                """
<p>Prior to  launching as an advertiser, our sales team must evaluate your business' compatibility with our network. In order to do so, a member of the team will be in touch via email within the next 48 hours with some additional questions.</p>
<p>Please note that should your site not meet the basic criteria below, we will not be able to launch you on our affiliate network at this time.</p>
<ul type="disc">
  <li>Site contains a secure shopping cart, a published return policy and guarantee, email communication confirming purchase and delivery of goods or services, and access to customer support</li>
  <li>Site contains no pop-ups on landing pages</li>
  <li>No template or blog sites</li>
  <li>Not a regional site that is only targeting a small market</li>
</ul>
<p>How to know if you’re an Advertiser or Publisher?<br /><br />
  What is an advertiser?<br />
  An advertiser, also known as a merchant or retailer, is a Web site or company that sells a product or service online, accepts payments and fulfills orders. Advertisers partner with publishers to help promote their products and services.<br /><br />
  What is a publisher?<br />
  A publisher, also known as an affiliate or reseller, is an independent party  that promotes products and services of an advertiser in exchange for a  commission on leads or sales. A publisher displays an advertiser's ads, text  links, or product links on their Web site, in e-mail campaigns, or in search  listings. Signing up as a publisher is a free service.<br /><br />
  If you have  completed the Advertiser sign-up form but are a better fit for a publisher  account, please contact client support at <a href="mailto:[email protected]">[email protected]</a> and we will assist in the transition  of your application.</p>
<p>Regards – <br />
  The Atrinsic  Affiliate Network Team</p>
<p>&nbsp;</p>
<p>*Atrinsic Interactive is a full-service interactive agency. We are not just a vertical search agency, ad network or affiliate network. We offer a cross-platform approach to deliver customers to you in the most cost-efficient manner possible. We bring together individual experts and sophisticated business tools to drive significant results for our advertisers.</p>
<p>**Atrinsic is an integrated media company. We drive growing audiences from our content network and third party distribution channels to acquire high value customers for advertisers and our own products. Atrinsic is now one of the top digital performance marketing companies<br />
  in the United States, which also provides exceptional entertainment content that draws 25 million unique visitors per month.</p>  
""", "text/html")
            msg.send()
            return AQ_render_to_response(
                request,
                'signup/complete.html', {},
                context_instance=RequestContext(request))
    else:
        form = AdvertiserSignupForm()
        captcha_form = CaptchaForm()

    return AQ_render_to_response(request,
                                 'signup/advertiser.html', {
                                     'form': form,
                                     'captcha_form': captcha_form,
                                 },
                                 context_instance=RequestContext(request))
Beispiel #14
0
def home(request):
    """index.html"""
    form = CaptchaForm(request.POST or None)
    if form.is_valid():
        return redirect('/?s=1')
    return render(request, 'index.html', {'form': form, 'success': request.GET.has_key('s')})