How to trigger perl scrip in Django
I am Newbie.recently started with django,how to trigger simple Perl script in django project, EX: small script in perl or bash to do a hello world to a file echo "hello world" > /home/hello.txt should be able to trigger the hello world script and see if the /home/hello.txt file has been created How can i do this.? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/L8AUQ0U2ic8J. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: How to trigger perl scrip in Django
OKi.no Am just trying out something different . On Tue, Jun 19, 2012 at 12:54 PM, kenneth gonsalves wrote: > On Mon, 2012-06-18 at 22:57 -0700, Pervez Mulla wrote: > > I am Newbie.recently started with django,how to trigger simple Perl > > script > > in django project, > > this has nothing to do with django - use python. Search for > subprocess.call() (is some professor somewhere giving his students an > assignment?) > -- > regards > Kenneth Gonsalves > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Hey
HI, How can I extract data from DB so that I can take that data n send it to templates to display graphs according to DataBase values . How can I write view function for that? Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django-Subscription
Hi... How can I make use Django_subscripation in my project...?? In my application I want to give subscription option , EX- If customers are subscribed to our product then they can able to access all the data, Else the customer will able to see only charts/graphs in webpage . How Can I do this? Pls help Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django-Subscription
can I use Paypal for this.? On Mon, Jul 9, 2012 at 9:07 PM, shacker wrote: > On Monday, July 9, 2012 2:54:06 AM UTC-7, Pervez Mulla wrote: >> >> Hi... >> >> How can I make use Django_subscripation in my project...?? In my >> application I want to give subscription option , >> EX- If customers are subscribed to our product then they can able to >> access all the data, Else the customer will able to see only >> charts/graphs in webpage . >> >> > When they subscribe, set a subscribed=True boolean field on their > Profile. Then you can test for request.user.get_profile.subscribed in your > templates. > > ./s > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/6bncs55YJQ8J. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
How to toggle active/inactive items on webpage using Djnago/python......?
Hey, In my webpage how can Active/Inactive some items based on user subscription? If customer is subscribed (Active)then he can able to access all the futures ,else customer will able to access only few(limited) items in webpage? How can do this in Djnago...? Please help me Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Login/ Logout user details
Hi, Please tell me how can I know ,the details about user login and logout details , and how can I store that data in DB in Django. Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
calling perl script from HTML on submit button
Hi, I have sign-up page, for that I have perl script to store the user details in DB .The DB code that has is auto-generated, i.e. we can just specify objects (User Details)and then it creates read and write functions for the DB. Next step is to also auto-generate some HTML forms based on these objects. That way I don't need to write new forms every-time, the code will auto generate HTML and i want to embbeded it in to Django-Framwork. So, How can execute perl scripts in Django framework,so that I can accomplish this function. Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: calling perl script from HTML on submit button
Thank you for your time and concern, Actually the entire back-end is in perl so, Am using Django for front-end. So am asking is there any why to call perl objects in python . On Mon, Aug 13, 2012 at 3:35 PM, Marcin Tustin wrote: > You do realise that django is a python framework? If you want to write > your app in Perl, use a Perl framework. > > On Aug 13, 2012 5:34 AM, "Pervez Mulla" wrote: > > > > Hi, > > > > I have sign-up page, for that I have perl script to store the > user details in DB .The DB code that has is auto-generated, i.e. we can > just specify objects (User Details)and then it creates read and write > functions for the DB. > > > > Next step is to also auto-generate some HTML forms based on these > objects. That way I don't need to write new forms every-time, the code > will auto generate HTML and i want to embbeded it in to Django-Framwork. > > > > So, > > > > How can execute perl scripts in Django framework,so that I > can accomplish this function. > > > > Thank You > > Pervez > > > > -- > > You received this message because you are subscribed to the Google > Groups "Django users" group. > > To post to this group, send email to django-users@googlegroups.com. > > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: I LOVE THIS COMMUNITY!
Yup.:) Really its very awesome community :) On Wed, Aug 22, 2012 at 9:19 AM, JJ Zolper wrote: > I agree too! > > > On Tuesday, August 21, 2012 7:38:45 PM UTC-4, Peith wrote: >> >> i agree > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/eqKeF9UQshwJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
After form validation, need to post and call a perl program to display to a log file
Hi, I have written code for form validation for different filed . Once validation happened (its working good), I wanna call perl script to disply it content to lof file ... How can I do this ..?? Please help me Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: After form validation, need to post and call a perl program to display to a log file
Hey Nick, Thank you for mail, Can I make use CGI script for this...? If yes how can I make use of that..? Hint>>!!\ Thank you pervez On Fri, Aug 24, 2012 at 8:30 PM, Nick Santos wrote: > Obligatory followup (though the docs I believe cover this pretty well) - > be *very* careful calling subprocess with anything related to a form > submission. Read the documents that Melvyn linked to carefully because you > can be opening a massive security hole. If this is just temporary to check > some output, that's fine, but if you plan on going into production, make > sure to know the risks and consider alternatives. > -Nick > > > On Friday, August 24, 2012 6:11:45 AM UTC-7, Melvyn Sopacua wrote: >> >> On 24-8-2012 8:41, Pervez Mulla wrote: >> >> > Once validation happened (its working good), I wanna call perl script >> to >> > disply it content to lof file ... >> > >> > >> > How can I do this ..?? >> >> <http://docs.python.org/**library/subprocess.html<http://docs.python.org/library/subprocess.html>> >> >> FYI, it don't matter that it's perl, you can do this for anything that >> can be invoked as a "program". >> >> -- >> Melvyn Sopacua >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/T4GGbPbHxGoJ. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Browser get closed when clicked on others links
Hi, I have developed simple website with Django framework. When i want to switch to other page, the browser getting closed..:( What the problem for this ? Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
How can I integrate simple Custom login page in Django.......?
Hi, I have login.html , login,js ang login.pl. I want to integrate basic login page in Django with perl back-end from where Am reading my DB. I was trying to integrate it from last day but come out with empty .There might be some settings in setting.py. Below is my code -- login.html -- http://www.w3.org/1999/xhtml";> #loginContent { width: 350px; margin: 100px auto; } button[type] { margin: 0.5em 0; } label {font-weight:bold;} fieldset {padding:0 1.4em 1.4em 1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;} legend {font-weight:bold;font-size:1.2em;margin-top:-0.2em;margin-bottom:1em;} fieldset, #IE8#HACK {padding-top:1.4em;} legend, #IE8#HACK {margin-top:0;margin-bottom:0;} input[type=text], input[type=password], input.text, input.title, textarea {background-color:#fff;border:1px solid #bbb;} input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus {border-color:#666;} select {background-color:#fff;border-width:1px;border-style:solid;} input[type=text], input[type=password], input.text, input.title, textarea, select {margin:0.5em 0;} input.text, input.title {width:300px;padding:5px;} input.title {font-size:1.5em;} textarea {width:390px;height:250px;padding:5px;} form.inline {line-height:3;} form.inline p {margin-bottom:0;} .error, .alert, .notice, .success, .info {padding:0.8em;margin-bottom:1em;border:2px solid #ddd;} .error, .alert {background:#fbe3e4;color:#8a1f11;border-color:#fbc2c4;} .notice {background:#fff6bf;color:#514721;border-color:#ffd324;} .success {background:#e6efc2;color:#264409;border-color:#c6d880;} .info {background:#d5edf8;color:#205791;border-color:#92cae4;} .error a, .alert a {color:#8a1f11;} .notice a {color:#514721;} .success a {color:#264409;} .info a {color:#205791;} Enter information Username Password Login - login.js - $(document).ready(function(){ $("form#loginForm").submit(function() { // loginForm is submitted var username = $('#username').attr('value'); // get username var password = $('#password').attr('value'); // get password if (username && password) { // values are not empty $.ajax({ type: "GET", url: "http://localhost:8080/cgi-bin/login.pl";, // URL of the Perl script contentType: "application/json; charset=utf-8", dataType: "json", data: "username=" + username + "&password=" + password, error: function(XMLHttpRequest, textStatus, errorThrown) { $('div#loginResult').text("responseText: " + XMLHttpRequest.responseText + ", textStatus: " + textStatus + ", errorThrown: " + errorThrown); $('div#loginResult').addClass("error"); }, // error success: function(data){ if (data.error) { // script returned error $('div#loginResult').text("data.error: " + data.error); $('div#loginResult').addClass("error"); } // if else { // login was successful $('form#loginForm').hide(); $('div#loginResult').text("data.success: " + data.success + ", data.userid: " + data.userid); $('div#loginResult').addClass("success"); } //else } // success }); // ajax } // if else { $('div#loginResult').text("enter username and password"); $('div#loginResult').addClass("error"); } // else $('div#loginResult').fadeIn(); return false; }); }); -- login.pl -- #!/usr/bin/perl -T use CGI; use DBI; use strict; use warnings; use netsharkusr; my $cgi = CGI->new; my $username = $cgi->param("username"); my $password = $cgi->param("password"); my $tempuser = new netsharkusr(); if($tempuser->readbyusername($username) eq 1) { if($tempuser->{username} eq $username) { print "success \n"; #exit; } } #$password = "123go"; my $userid; my $tempuser2 = new netsharkusr(); if($tempuser2->readbypassword($password)) { if($tempuser2->{password} eq $password) { print "sccess \n"; $userid = $tempuser2->{userID}; } } # check the username and password in the database # create a JSON string according to the database result my $json = ($userid) ? qq{{"success" : "login is successful", "userid" : $userid}} : qq{{"error" : "username or password is wrong"}}; # return JSON string print $cgi->header(-type => "application/json", -charset => "utf-8"); print $json; How can I do this ..? Please Help Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group.
Re: How can I integrate simple Custom login page in Django.......?
Thank You for your response Sergiy , I already try'd to run this script as shown in Django DOC as u given .but still it didnt work:( Thank You Pervez On Mon, Oct 15, 2012 at 1:28 PM, Sergiy Khohlov wrote: > https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-LOGIN_URL > > set this one in setting.py > > 2012/10/15 Pervez Mulla : > > Hi, > > > > I have login.html , login,js ang login.pl. > > > > I want to integrate basic login page in Django with perl back-end from > where > > Am reading my DB. > > I was trying to integrate it from last day but come out with empty .There > > might be some settings in setting.py. > > Below is my code > > > > -- > > login.html > > -- > > http://www.w3.org/1999/xhtml";> > > > > > > > > > > > > #loginContent { width: 350px; margin: 100px auto; } > > button[type] { margin: 0.5em 0; } > > label {font-weight:bold;} > > fieldset {padding:0 1.4em 1.4em 1.4em;margin:0 0 1.5em 0;border:1px solid > > #ccc;} > > legend > > {font-weight:bold;font-size:1.2em;margin-top:-0.2em;margin-bottom:1em;} > > fieldset, #IE8#HACK {padding-top:1.4em;} > > legend, #IE8#HACK {margin-top:0;margin-bottom:0;} > > input[type=text], input[type=password], input.text, input.title, textarea > > {background-color:#fff;border:1px solid #bbb;} > > input[type=text]:focus, input[type=password]:focus, input.text:focus, > > input.title:focus, textarea:focus {border-color:#666;} > > select {background-color:#fff;border-width:1px;border-style:solid;} > > input[type=text], input[type=password], input.text, input.title, > textarea, > > select {margin:0.5em 0;} > > input.text, input.title {width:300px;padding:5px;} > > input.title {font-size:1.5em;} > > textarea {width:390px;height:250px;padding:5px;} > > form.inline {line-height:3;} > > form.inline p {margin-bottom:0;} > > .error, .alert, .notice, .success, .info > > {padding:0.8em;margin-bottom:1em;border:2px solid #ddd;} > > .error, .alert {background:#fbe3e4;color:#8a1f11;border-color:#fbc2c4;} > > .notice {background:#fff6bf;color:#514721;border-color:#ffd324;} > > .success {background:#e6efc2;color:#264409;border-color:#c6d880;} > > .info {background:#d5edf8;color:#205791;border-color:#92cae4;} > > .error a, .alert a {color:#8a1f11;} > > .notice a {color:#514721;} > > .success a {color:#264409;} > > .info a {color:#205791;} > > > > > > > > > > > > > > > > > > Enter information > > > > Username > id="username" name="username" class="text" size="20" /> > > > > > > Password > id="password" name="password" class="text" size="20" /> > > > > > > > />Login > > > > > > > > > > > > > > > > - > > login.js > > - > > $(document).ready(function(){ > > $("form#loginForm").submit(function() { // loginForm is submitted > > var username = $('#username').attr('value'); // get username > > var password = $('#password').attr('value'); // get password > > > > if (username && password) { // values are not empty > > $.ajax({ > > type: "GET", > > url: "http://localhost:8080/cgi-bin/login.pl";, // URL of the > Perl > > script > > contentType: "application/json; charset=utf-8", > > dataType: "json", > > data: "username=" + username + "&password=" + password, > > error: function(XMLHttpRequest, textStatus, errorThrown) { > > $('div#loginResult').text("responseText: " + > > XMLHttpRequest.responseText > > + ", textStatus: " + textStatus > > + ", errorThrown: " + errorThrown); > > $('div#loginResult').addClass("error"); > > }, // error > > success: function(data){ > > if (data.error) { // script returned error > > $('div#loginResult').text("data.error: " + data.error); > > $('div#loginResult').a
Re: How can I integrate simple Custom login page in Django.......?
On error note its printing all pelr script itself. On Mon, Oct 15, 2012 at 3:31 PM, Sergiy Khohlov wrote: > please provide error message > > 2012/10/15 Pervez Mulla : > > Thank You for your response Sergiy , > > > > I already try'd to run this script as shown in Django DOC as u given .but > > still it didnt work:( > > > > Thank You > > Pervez > > > > On Mon, Oct 15, 2012 at 1:28 PM, Sergiy Khohlov > wrote: > >> > >> > https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-LOGIN_URL > >> > >> set this one in setting.py > >> > >> 2012/10/15 Pervez Mulla : > >> > Hi, > >> > > >> > I have login.html , login,js ang login.pl. > >> > > >> > I want to integrate basic login page in Django with perl back-end from > >> > where > >> > Am reading my DB. > >> > I was trying to integrate it from last day but come out with empty > >> > .There > >> > might be some settings in setting.py. > >> > Below is my code > >> > > >> > -- > >> > login.html > >> > -- > >> > http://www.w3.org/1999/xhtml";> > >> > > >> > >> > /> > >> > > >> > > >> > > >> > #loginContent { width: 350px; margin: 100px auto; } > >> > button[type] { margin: 0.5em 0; } > >> > label {font-weight:bold;} > >> > fieldset {padding:0 1.4em 1.4em 1.4em;margin:0 0 1.5em 0;border:1px > >> > solid > >> > #ccc;} > >> > legend > >> > > {font-weight:bold;font-size:1.2em;margin-top:-0.2em;margin-bottom:1em;} > >> > fieldset, #IE8#HACK {padding-top:1.4em;} > >> > legend, #IE8#HACK {margin-top:0;margin-bottom:0;} > >> > input[type=text], input[type=password], input.text, input.title, > >> > textarea > >> > {background-color:#fff;border:1px solid #bbb;} > >> > input[type=text]:focus, input[type=password]:focus, input.text:focus, > >> > input.title:focus, textarea:focus {border-color:#666;} > >> > select {background-color:#fff;border-width:1px;border-style:solid;} > >> > input[type=text], input[type=password], input.text, input.title, > >> > textarea, > >> > select {margin:0.5em 0;} > >> > input.text, input.title {width:300px;padding:5px;} > >> > input.title {font-size:1.5em;} > >> > textarea {width:390px;height:250px;padding:5px;} > >> > form.inline {line-height:3;} > >> > form.inline p {margin-bottom:0;} > >> > .error, .alert, .notice, .success, .info > >> > {padding:0.8em;margin-bottom:1em;border:2px solid #ddd;} > >> > .error, .alert > {background:#fbe3e4;color:#8a1f11;border-color:#fbc2c4;} > >> > .notice {background:#fff6bf;color:#514721;border-color:#ffd324;} > >> > .success {background:#e6efc2;color:#264409;border-color:#c6d880;} > >> > .info {background:#d5edf8;color:#205791;border-color:#92cae4;} > >> > .error a, .alert a {color:#8a1f11;} > >> > .notice a {color:#514721;} > >> > .success a {color:#264409;} > >> > .info a {color:#205791;} > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > Enter information > >> > > >> > Username >> > id="username" name="username" class="text" size="20" /> > >> > > >> > > >> > Password type="password" > >> > id="password" name="password" class="text" size="20" /> > >> > > >> > > >> > alt="ok" > >> > />Login > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > - > >> > login.js > >> > - > >> > $(document).ready(function(){ > >> > $("form#loginForm").submit(function() { // loginForm is submitted > >> > var username = $('#username').attr('value'); // get username > >> >
Re: How can I integrate simple Custom login page in Django.......?
responseText: #!/usr/bin/perl -T use CGI; use DBI; use strict; use warnings; use netsharkusr; my $cgi = CGI->new; my $username = $cgi->param("username"); my $password = $cgi->param("password"); my $tempuser = new netsharkusr(); if($tempuser->readbyusername($username) eq 1) { if($tempuser->{username} eq $username) { print "success \n"; #exit; } } #$password = "123go"; my $userid; my $tempuser2 = new netsharkusr(); if($tempuser2->readbypassword($password)) { if($tempuser2->{password} eq $password) { print "sccess \n"; $userid = $tempuser2->{userID}; } } # check the username and password in the database # create a JSON string according to the database result my $json = ($userid) ? qq{{"success" : "login is successful", "userid" : $userid}} : qq{{"error" : "username or password is wrong"}}; # return JSON string print $cgi->header(-type => "application/json", -charset => "utf-8"); print $json;, textStatus: parsererror, errorThrown: undefined On Mon, Oct 15, 2012 at 4:07 PM, Sergiy Khohlov wrote: > please provide error > > 2012/10/15 Pervez Mulla : > > On error note its printing all pelr script itself. > > > > > > On Mon, Oct 15, 2012 at 3:31 PM, Sergiy Khohlov > wrote: > >> > >> please provide error message > >> > >> 2012/10/15 Pervez Mulla : > >> > Thank You for your response Sergiy , > >> > > >> > I already try'd to run this script as shown in Django DOC as u given > >> > .but > >> > still it didnt work....:( > >> > > >> > Thank You > >> > Pervez > >> > > >> > On Mon, Oct 15, 2012 at 1:28 PM, Sergiy Khohlov > >> > wrote: > >> >> > >> >> > >> >> > https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-LOGIN_URL > >> >> > >> >> set this one in setting.py > >> >> > >> >> 2012/10/15 Pervez Mulla : > >> >> > Hi, > >> >> > > >> >> > I have login.html , login,js ang login.pl. > >> >> > > >> >> > I want to integrate basic login page in Django with perl back-end > >> >> > from > >> >> > where > >> >> > Am reading my DB. > >> >> > I was trying to integrate it from last day but come out with empty > >> >> > .There > >> >> > might be some settings in setting.py. > >> >> > Below is my code > >> >> > > >> >> > -- > >> >> > login.html > >> >> > -- > >> >> > http://www.w3.org/1999/xhtml";> > >> >> > > >> >> > >> >> > /> > >> >> > >> >> > src="jquery-1.7.2.min.js"> > >> >> > > >> >> > > >> >> > #loginContent { width: 350px; margin: 100px auto; } > >> >> > button[type] { margin: 0.5em 0; } > >> >> > label {font-weight:bold;} > >> >> > fieldset {padding:0 1.4em 1.4em 1.4em;margin:0 0 1.5em 0;border:1px > >> >> > solid > >> >> > #ccc;} > >> >> > legend > >> >> > > >> >> > > {font-weight:bold;font-size:1.2em;margin-top:-0.2em;margin-bottom:1em;} > >> >> > fieldset, #IE8#HACK {padding-top:1.4em;} > >> >> > legend, #IE8#HACK {margin-top:0;margin-bottom:0;} > >> >> > input[type=text], input[type=password], input.text, input.title, > >> >> > textarea > >> >> > {background-color:#fff;border:1px solid #bbb;} > >> >> > input[type=text]:focus, input[type=password]:focus, > input.text:focus, > >> >> > input.title:focus, textarea:focus {border-color:#666;} > >> >> > select {background-color:#fff;border-width:1px;border-style:solid;} > >> >> > input[type=text], input[type=password], input.text, input.title, > >> >> > textarea, > >> >> > select {margin:0.5em 0;} > >> >> > input.text, input.title {width:300px;padding:5px;} > >> >> > input.title {font-size:1.5em;} > >> >> > textarea {width:390px;height:250px;padding:5px;} > >> >> > form.inline {line-height:3;} > >> >> > form.inline p {margin-bottom:0;} > &g
Re: How can I integrate simple Custom login page in Django.......?
Instead of CGI server path , I places perl script in static folder and given path for that . On Mon, Oct 15, 2012 at 4:09 PM, Pervez Mulla wrote: > responseText: #!/usr/bin/perl -T use CGI; use DBI; use strict; use > warnings; use netsharkusr; my $cgi = CGI->new; my $username = > $cgi->param("username"); my $password = $cgi->param("password"); my > $tempuser = new netsharkusr(); if($tempuser->readbyusername($username) eq > 1) { if($tempuser->{username} eq $username) { print "success \n"; #exit; } > } #$password = "123go"; my $userid; my $tempuser2 = new netsharkusr(); > if($tempuser2->readbypassword($password)) { if($tempuser2->{password} eq > $password) { print "sccess \n"; $userid = $tempuser2->{userID}; } } # check > the username and password in the database # create a JSON string according > to the database result my $json = ($userid) ? qq{{"success" : "login is > successful", "userid" : $userid}} : qq{{"error" : "username or password is > wrong"}}; # return JSON string print $cgi->header(-type => > "application/json", -charset => "utf-8"); print $json;, textStatus: > parsererror, errorThrown: undefined > > > On Mon, Oct 15, 2012 at 4:07 PM, Sergiy Khohlov wrote: > >> please provide error >> >> 2012/10/15 Pervez Mulla : >> > On error note its printing all pelr script itself. >> > >> > >> > On Mon, Oct 15, 2012 at 3:31 PM, Sergiy Khohlov >> wrote: >> >> >> >> please provide error message >> >> >> >> 2012/10/15 Pervez Mulla : >> >> > Thank You for your response Sergiy , >> >> > >> >> > I already try'd to run this script as shown in Django DOC as u given >> >> > .but >> >> > still it didnt work:( >> >> > >> >> > Thank You >> >> > Pervez >> >> > >> >> > On Mon, Oct 15, 2012 at 1:28 PM, Sergiy Khohlov >> >> > wrote: >> >> >> >> >> >> >> >> >> >> https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-LOGIN_URL >> >> >> >> >> >> set this one in setting.py >> >> >> >> >> >> 2012/10/15 Pervez Mulla : >> >> >> > Hi, >> >> >> > >> >> >> > I have login.html , login,js ang login.pl. >> >> >> > >> >> >> > I want to integrate basic login page in Django with perl back-end >> >> >> > from >> >> >> > where >> >> >> > Am reading my DB. >> >> >> > I was trying to integrate it from last day but come out with empty >> >> >> > .There >> >> >> > might be some settings in setting.py. >> >> >> > Below is my code >> >> >> > >> >> >> > -- >> >> >> > login.html >> >> >> > -- >> >> >> > http://www.w3.org/1999/xhtml";> >> >> >> > >> >> >> > > >> >> > /> >> >> >> > > >> >> > src="jquery-1.7.2.min.js"> >> >> >> > >> >> >> > >> >> >> > #loginContent { width: 350px; margin: 100px auto; } >> >> >> > button[type] { margin: 0.5em 0; } >> >> >> > label {font-weight:bold;} >> >> >> > fieldset {padding:0 1.4em 1.4em 1.4em;margin:0 0 1.5em >> 0;border:1px >> >> >> > solid >> >> >> > #ccc;} >> >> >> > legend >> >> >> > >> >> >> > >> {font-weight:bold;font-size:1.2em;margin-top:-0.2em;margin-bottom:1em;} >> >> >> > fieldset, #IE8#HACK {padding-top:1.4em;} >> >> >> > legend, #IE8#HACK {margin-top:0;margin-bottom:0;} >> >> >> > input[type=text], input[type=password], input.text, input.title, >> >> >> > textarea >> >> >> > {background-color:#fff;border:1px solid #bbb;} >> >> >> > input[type=text]:focus, input[type=password]:focus, >> input.text:focus, >> >> >> > input.title:focus, textarea:focus {border-color:#666;} >> >> >> > select >> {back
Trying to send key value pair to perl script using subprocess
Hi, I am trying to send key:value pair to perl script via sub-process module . I just tried with simple example it works fine. How can I pass key:value pair to perl script .? Ans also how can send multiple input fields value to perls script> Below is my code view.py - from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from subprocess import Popen, PIPE, sys import subprocess def ex(request): myName = 'Pervez' if 'firstname' in request.POST: myName = (request.POST['firstname']) p = Popen(['/home/pervez/Desktop/simplepage/simplepage/templates/ex.pl', myName],stdin=PIPE, stdout=PIPE) p.stdin.close() result = p.stdout.read() return render_to_response('ex.html', {'name': result},context_instance=RequestContext(request)) ex.pl #!/usr/bin/perl $|=1;# Flush immediately. print "Content-Type: text/plain\n\n"; read(STDIN,$form, $ENV{'CONTENT_LENGTH'}); foreach $pair (split('&', $form)) { if ($pair =~ /(.*)=(.*)/) { # found key=value; ($key,$value) = ($1,$2); # get key, value. $value =~ s/\+/ /g; # substitute spaces for + signs. $value =~ s/%(..)/pack('c',hex($1))/eg; $inputs{$key} = $value; # Create Associative Array. } } foreach $item (keys(%inputs)) { print "$item - $inputs{$item}\n"; } ex.html --- {{ name }} {% csrf_token %} Signup Form First Name Last Name User Name Password Verify Password Your E-mail Please Help me Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/t5r_rscbvOEJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Struggling with static files
Give path to your STATIC_ROOT of your static folder. Pervez On Mon, Oct 22, 2012 at 2:26 PM, DJ-Tom wrote: > Hi, > > I'm fairly new with Django and currently I'm only "playing around" to get > a better feeling for the framework. > > I have read the documentation and almost all of the posts here about > configuring static files with the development server but can't get it > working. > > I wanted to modify the admin login screen to show a company logo, so I > copied base_site.html to /templates/admin/ and added this: > > > > > This is how my directory structure looks like: > > el_test > el_test > static >logo.gif > settings.py > urls.py > templates > admin > base_site.html > > - Settings.py: > > STATIC_ROOT = '' > STATIC_URL = '/static/' > STATICFILES_DIRS = ( > ) > STATICFILES_FINDERS = ( > 'django.contrib.staticfiles.finders.FileSystemFinder', > 'django.contrib.staticfiles.finders.AppDirectoriesFinder', > ) > > I also added the following to urls.py > >urlpatterns += staticfiles_urlpatterns() > > The HTML in the admin logon screen looks like this, so basically the URL > seems to be OK > > > > Test Admin > > > Calling http://localhost:8000/static/logo.gif directly shows a 404 error. > > As far as I have understood this should work with the dev server and > debug=true without calling collectstatic > > I have also tried moving the /static/ folder around various locations > below the project directory... > > I'm sure there is only some small thing missing... > > Any help is highly appreciated :-) > > Thomas > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/YqVkguDtVwEJ. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Struggling with static files
something like this in your setting.py STATIC_ROOT = ''/home/john/yourprojectdir/yourappdir/staic/" On Mon, Oct 22, 2012 at 2:48 PM, Xavier Ordoquy wrote: > Hi, > > Your static folder should be declared in STATICFILES_DIRS if you want him > to be served (see > https://docs.djangoproject.com/en/1.4/howto/static-files/#basic-usage about > that). > > Please take care to give another name to STATIC_ROOT for production > settings. > > Regards, > Xavier Ordoquy, > Linovia. > > > Le 22 oct. 2012 à 10:56, DJ-Tom a écrit : > > Hi, > > I'm fairly new with Django and currently I'm only "playing around" to get > a better feeling for the framework. > > I have read the documentation and almost all of the posts here about > configuring static files with the development server but can't get it > working. > > I wanted to modify the admin login screen to show a company logo, so I > copied base_site.html to /templates/admin/ and added this: > > > > > This is how my directory structure looks like: > > el_test > el_test > static >logo.gif > settings.py > urls.py > templates > admin > base_site.html > > - Settings.py: > > STATIC_ROOT = '' > STATIC_URL = '/static/' > STATICFILES_DIRS = ( > ) > STATICFILES_FINDERS = ( > 'django.contrib.staticfiles.finders.FileSystemFinder', > 'django.contrib.staticfiles.finders.AppDirectoriesFinder', > ) > > I also added the following to urls.py > >urlpatterns += staticfiles_urlpatterns() > > The HTML in the admin logon screen looks like this, so basically the URL > seems to be OK > > > > Test Admin > > > Calling http://localhost:8000/static/logo.gif directly shows a 404 error. > > As far as I have understood this should work with the dev server and > debug=true without calling collectstatic > > I have also tried moving the /static/ folder around various locations > below the project directory... > > I'm sure there is only some small thing missing... > > Any help is highly appreciated :-) > > Thomas > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/YqVkguDtVwEJ. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Template Inheriting in Apache server
Hi, Sorry for this question in this group .I Just wanted to know is there any way , I can Inherit different HTML templates from base.html as we do in Django framework in Apache2 server? Thank You Pervez -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.