Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #27144

Re: how to call perl script from html using python

From Pervez Mulla <mullapervez@gmail.com>
Newsgroups comp.lang.python
Subject Re: how to call perl script from html using python
Date 2012-08-16 00:23 -0700
Organization http://groups.google.com
Message-ID <18ec5f51-ceca-4ecb-82b4-c472ea2faa22@googlegroups.com> (permalink)
References <1df80eca-4dc2-48c6-9804-77e993931244@googlegroups.com>

Show all headers | View raw


On Tuesday, August 14, 2012 10:42:48 AM UTC+5:30, Pervez Mulla wrote:
> Hi,
> 
> 
> 
> I wanna call perl script in HTML form n store that data in DB using Python.
> 
> 
> 
> How can i do this.......??
> 
> 
> 
> Please help me
> 
> 
> 
> Thank you
> 
> Pervez



On Tuesday, August 14, 2012 10:42:48 AM UTC+5:30, Pervez Mulla wrote:
> Hi,
> 
> 
> 
> I wanna call perl script in HTML form n store that data in DB using Python.
> 
> 
> 
> How can i do this.......??
> 
> 
> 
> Please help me
> 
> 
> 
> Thank you
> 
> Pervez



On Tuesday, August 14, 2012 10:42:48 AM UTC+5:30, Pervez Mulla wrote:
> Hi,
> 
> 
> 
> I wanna call perl script in HTML form n store that data in DB using Python.
> 
> 
> 
> How can i do this.......??
> 
> 
> 
> Please help me
> 
> 
> 
> Thank you
> 
> Pervez



On Tuesday, August 14, 2012 10:42:48 AM UTC+5:30, Pervez Mulla wrote:
> Hi,
> 
> 
> 
> I wanna call perl script in HTML form n store that data in DB using Python.
> 
> 
> 
> How can i do this.......??
> 
> 
> 
> Please help me
> 
> 
> 
> Thank you
> 
> Pervez

Hey Steven ,

Thank you for your response,

I will in detail now about my project,

Actually the project entire backend in PERL language , Am using Django framework for my front end .

I have written code for signup page in python , which is working perfectly .

In HTml when user submit POST method, it calling Python code ....Instead of this I wanna call perl script for sign up ......
 
below in form for sign up page in python ....

form.py
from django import forms
from django.contrib.auth.models import User
from django.forms import ModelForm
from user_profile.models import Profile

class RegistrationForm(ModelForm):
    username    = forms.CharField(label=(u'User Name'))
    email       = forms.EmailField(label=(u'E-mail'))
    password    = forms.CharField(label=(u'Password'),widget=forms.PasswordInput(render_value=False))
    password1   = forms.CharField(label=(u'Verify Password'),widget=forms.PasswordInput(render_value=False))

    class Meta:
        model = Profile
        exclude = ('user',)
        
    def clean_username(self):
        username = self.cleaned_data['username']
        try:
            User.objects.get(username==username)
        except User.DoesNotExist:
            return username
        raise forms.ValidationError("That username is already taken. Please select another.")
        
    def clean_password(self):
        if self.cleaned_data['password'] != self.cleaned_data['password1']:
            raise forms.ValidationError("Password didnt match... Please try again")
        return self.cleaned_data
-----------------------------------------------------------------------------

view.py


def ProfileRegistration(request):
    if request.user.is_authenticated():
        return HttpResponseRedirect('/profile/')
    if request.method =="POST":
        form = RegistrationForm(request.POST)
        if form.is_valid():
            user = User.objects.create_user(username = form.cleaned_data['username'],
                                            email = form.cleaned_data['email'],
                                            password = form.cleaned_data['password'])
            user.save()
            profile = Profile(user=user, firstname=form.cleaned_data['firstname'],
                                         lastname=form.cleaned_data['lastname'],
                                         phone=form.cleaned_data['phone'],
                                         title=form.cleaned_data['title'],
                                         companyname=form.cleaned_data['companyname'])
            profile.save()
            return HttpResponseRedirect('/profile/')
        else:
            return render_to_response ('register.html',{'form':form},context_instance=RequestContext(request))
    else: 
        form = RegistrationForm()
        context = {'form':form}
        return render_to_response('register.html', context, context_instance=RequestContext(request))


In view instead invoking python script I wanna invoke Perl script .....for the signup page 


Thank You


   

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to call perl script from html using python mullapervez@gmail.com - 2012-08-13 22:12 -0700
  Re: how to call perl script from html using python Simon Cropper <simoncropper@fossworkflowguides.com> - 2012-08-14 15:22 +1000
  Re: how to call perl script from html using python mullapervez@gmail.com - 2012-08-13 22:31 -0700
    Re: how to call perl script from html using python Simon Cropper <simoncropper@fossworkflowguides.com> - 2012-08-14 15:44 +1000
  Re: how to call perl script from html using python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-14 06:00 +0000
  Re: how to call perl script from html using python Pervez Mulla <mullapervez@gmail.com> - 2012-08-13 23:21 -0700
    Re: how to call perl script from html using python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-14 07:19 +0000
  Re: how to call perl script from html using python Pervez Mulla <mullapervez@gmail.com> - 2012-08-16 00:23 -0700
    Re: how to call perl script from html using python andrea crotti <andrea.crotti.0@gmail.com> - 2012-08-16 12:00 +0100

csiph-web