Integration of Django with other python codes

25 views
Skip to first unread message

sunith...@algonox.com

unread,
Jun 15, 2017, 8:14:20 AM6/15/17
to Django users
Hi guys,
 Im a newbee to Django.. Actually I was trying to integrate my python code to Django web application.. 
For example.. Im having a python code in which if i enter any input it will generate an output.. 
                       In web application I have one input box, button and text area.. When I enter any text(hello) inside the textbox and hit enter means then it should call my python code and pass the text(hello) as an input argument to the code and pass the output(Welcome) to be passed to the textarea of the web app.
 

If anyone knows help me to solve this!!

Jani Tiainen

unread,
Jun 15, 2017, 8:19:11 AM6/15/17
to django...@googlegroups.com

Hi,

If you have done the official tutorial [1], you should already hold all the knowledge required to do what you asked.

[1] https://docs.djangoproject.com/en/1.11/intro/tutorial01/
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6316cf1b-91b9-4a64-9152-f6df0e21ba66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Jani Tiainen

yingi keme

unread,
Jun 15, 2017, 7:30:55 PM6/15/17
to django...@googlegroups.com
You have to study django tutorials.

Ok for a simple task like this. After you have successfully created your app in your project, all you need is to configure your url so it can point the views.py.

The views.py file will have a function like this

def myInput(request, input):
      return render(...)

It is this function in your views.py that will be called when you hit enter. So you can do whatever you wish with your input inside this function.

Take note. This is just a sketch of how django calls python functions to handle request, forms etc.

Yingi Kem
--
Reply all
Reply to author
Forward
0 new messages