Header Ads

Run External Python Script on Clicking Html Button Part 2

In this part I continue my tutorial on Running Python Script by Clicking HTML Button. Here I will create a HTML form and submit button & once a user clicks on HTML button, values from HTML Form will be passed to a External Python Script and Output of script will be Mapped to HTML Page.
Before continuing this tutorial i will suggest you to watch the Part 1 of this tutorial where we Configured the Python Django Part for Creating HTML Template.

All the Code from this Video:

Python Django Code : 

Views.py : 
from django.shortcuts import render import requests
import sys
from subprocess import run,PIPE
def button(request):
return render(request,'home.html')
def output(request):
return render(request,'home.html',{'data':data})
def external(request):
inp= request.POST.get('param')
out= run([sys.executable,'//mnt//e//work//djnago_testing//test.py',inp],shell=False,stdout=PIPE)
return render(request,'home.html',{'data1':out.stdout})
from django.conf.urls import url
django.contrib import admin
from . import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', views.button),
url(r'^output', views.output,name="script"),
url(r'^external', views.external),

Home.html :

<!DOCTYPE html>
Python button script
<button onclick="location.href='{% url 'script' %}'">Execute Script</button> <hr>
{% if data %}
{{data | safe}}
{% endif %}
<form action="/external/" method="post">
{% csrf_token %}
Input Text:
<input type="text" name="param" required><br><br>
<input type="submit" value="Execute External Python Script">

External Python Script :

import sys
import datetime
output="Hi %s currentadfwffffdwadwd time is %s" % (sys.argv[1],time)


  1. hey man i need your help urgent
    i do not want to give any input but just a button that will enable me to execute .py file and print the output it on webpage



    from django.contrib import admin
    from django.urls import path
    from . import views
    urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.button),
    path('output', views.output)

    from django.shortcuts import render
    import requests
    import sys
    from subprocess import run,PIPE

    def button(request):
    return render(request,'home.html')

    def output(request):
    out = run(sys.executable,['E://a.py'],shell=False,stdout=PIPE)
    return render(request,'home.html',{'data':out})

    1. ⚡️☑️MEET THE REAL HACKERS☑️⚡️

      It Tears me Up Whenever we receive complaints from Clients About Their Experience With the Hackers They Met Before They Heard about us.
      These Days There Are alot of Hackers Online, You Just Have to Be Careful about who you meet for help, because many people now don't know who to ask for help anymore but there's really an actual solution to that which I am giving you for free, Don't go for the incompetent ones which I know you understand what I'm saying like hackers using gmail, yahoomail and other cheaper email accounts that could be easily hacked ⚠️🚷, come to think of it, why the fuck would a REAL HACKER want to use a Mailing Service that brings out his vulnerabilities? ❌❌ ❌ so can you see they are really not who they say they're, they are just here to Rip people Off, You Can Always Identify Them With Their False Write Ups and False Testimonies Trying To Lure you Into their Arms.❌❌❌ and my advice really goes out to you looking for a Real Hacker that's a heads up so that you wouldn’t fall deep into their trap no more.🚷⚠️⚠️⚠️

      ☑️ COMPOSITE CYBER SECURITY SPECIALISTS is here to Provide you with The Best Hackers, So you can get saved from The Arms of the Fake Hackers❌❌

      ☑️We have Legit Hackers and Private investigators at your service. 💻 Every member of our team is well experienced in their various niches with Great Skills, Technical Hacking Strategies And Positive Online Reviews And Recommendations💻🛠

      ☑️We have Digital Forensic Specialists, Certified Ethical Hackers, Computer Engineers, Cyber Security Experts, Private investigators and more on our team. Some Of These Specialist Includes ⭐️ DAWID CZAGAN⭐️ JACK CABLE ⭐️ SEAN MELIA ⭐️ ARNE SWINNEN ⭐️And More.
      Some Of The Services we render includes:
      * Website hacking 💻
      * Facebook and social media hacking 📲
      * Database hacking, & Blog Cleaning🛠
      * Phone and Gadget Hacking 📲
      * Clearing Of Criminal Records ❌
      * Location Tracking 📲
      and many More

      ☑️ Our Goal is to make your digital life secure, safe and hassle-free. All you Need To do is To Write us a Mail Then We’ll Assigned any of These Hackers To You Instantly.

      ☑️ CONTACT:
      ••• Email:

      🔘2020 © composite cybersecurity specialists
      🔘Want faster service? Contact us!
      🔘All Rights Reserved ®️

  2. hey man i need your help urgent!
    if i using uwsgi +nginx + django
    it say unable to load configuration from test.py

  3. Excellent and professional investigative services. I hired Mr FRED for a very private and difficult matter of hacking my husband's phone and he far exceeded my expectations. He helped me get some info such as whatsapp, facebook, text messages, call logs and even phone conversations that I needed for proof of his secretive affair. The first time we spoke, we had a very long phone consultation in which he gave me all my options that he could think of to resolve my case, and he even recommended I try other options before hiring him, which shows that he is honest. I decided to hire him and I am glad I did. He is a fantastic investigator and a great person; to all loyal partners out there if you have a dishonest partner don't hesitate to send him a mail Contact: CYBERAPPHACK@GMAIL.COM.

  4. the argument is not getting passed to the python script

  5. Page not found (404)
    Request Method: POST
    Request URL:
    Using the URLconf defined in autowpnow.urls, Django tried these URL patterns, in this order:

    output [name='script']
    The current path, external/, didn't match any of these.

    By following the 2nd video it shows this error. Could you provide a solution for this issue

    1. Are you using proper web page is that your correct port? are you reading the correct view.external page?

    2. You should have:
      path('external/', views.external)
      instead of:
      path('external', views.external)

  6. hey! its working but i am not getting the output properly!

    b"Hi Panchal! how's you doing, After evaluating your expression,we have got the value as 30\r\n"

    Expected OUTPUT:
    Hi Panchal! how's you doing, After evaluating your expression,we have got the value as 30


    Hello my dear people, I am Linda McDonald, currently living in Austin Texas, USA. I am a widow at the moment with three kids and i was stuck in a financial situation in April 2018 and i needed to refinance and pay my bills. I tried seeking loans from various loan firms both private and corporate but never with success, and most banks declined my credit ,do not full prey to those hoodlums at there that call them self-money lender they are all scam , all they want is your money and you well not hear from them again they have done it to me twice before I met Mr. David Wilson the most interesting part of it is that my loan was transfer to me within 74hours so I will advise you to contact Mr. David if you are interested in getting loan and you are sure you can pay him back on time you can contact him via email……… (davidwilsonloancompany4@gmail.com) No credit check, no cosigner with just 2% interest rate and better repayment plans and schedule if you must contact any firm with reference to securing a loan without collateral then contact Mr. David Wilson today for your loan

    They offer all kind of categories of loan they

    Short term loan (5_10years)
    Long term loan (20_40)
    Media term loan (10_20)
    They offer loan like
    Home loan............., Business loan........ Debt loan.......
    Student loan.........., Business startup loan
    Business loan......., Company loan.............. etc
    Email..........( davidwilsonloancompany4@gmail.com)
    When it comes to financial crisis and loan then David Wilson loan financial is the place to go please just tell him I Mrs. Linda McDonald direct you Good Luck.......................

  8. Are you interested in the service of a hacker to get into a phone, facebook account, snapchat, Instagram, yahoo, Whatsapp, get verified on any social network account, increase your followers by any amount, bank wire and bank transfer. Contact him on= hackintechnology.com hackintechnology@gmail.com +12132951376


Powered by Blogger.