Re: mathematical function and django connect

2016-03-03 Thread James Schneider
On Thu, Mar 3, 2016 at 10:48 AM, Xristos Xristoou wrote: > update my code khow i feel so close but not work again hahaha to many > problems > > . I want to write a django code which takes a number and a list of numbers > from the website as user input and and then export a list with results. but

Re: mathematical function and django connect

2016-03-03 Thread Xristos Xristoou
update my code khow i feel so close but not work again hahaha to many problems . I want to write a django code which takes a number and a list of numbers from the website as user input and and then export a list with results. but if i run my app don't show me results from the progress in html t

Re: mathematical function and django connect

2016-02-29 Thread James Schneider
On Sun, Feb 28, 2016 at 2:06 PM, Xristos Xristoou wrote: > update my project now > > my view.py code > > def calc(request): > a = [] > NList = [] > y=0 > member=0 > member = request.POST.get ('member', False) > for i in range(int(member)): >

Re: mathematical function and django connect

2016-02-28 Thread Xristos Xristoou
update my project now my view.py code def calc(request): a = [] NList = [] y=0 member=0 member = request.POST.get ('member', False) for i in range(int(member)): input = request.POST.get ('input', False) NList.append(int(input

Re: mathematical function and django connect

2016-02-23 Thread James Schneider
On Mon, Feb 22, 2016 at 12:08 PM, Xristos Xristoou wrote: > the problem in the html form we need to change second input to > take multiple values,for example first input take a number > and the second input take many numbers..if the first number = 2 then take > second input two numbers,two fields

Re: mathematical function and django connect

2016-02-22 Thread Xristos Xristoou
the problem in the html form we need to change second input to take multiple values,for example first input take a number and the second input take many numbers..if the first number = 2 then take second input two numbers,two fields for input i try this but not work orm action="" method="POST">{%

Re: mathematical function and django connect

2016-02-22 Thread James Schneider
On Sun, Feb 21, 2016 at 9:33 PM, Xristos Xristoou wrote: > i find it,just add return render_to_response('blog/calc.html', {'a' > :a},context_instance=RequestContext(request)) > and dont show me that error,but not work again > now if i touch calc button just reload dont show me error dont show me

Re: mathematical function and django connect

2016-02-21 Thread Xristos Xristoou
i find it,just add return render_to_response('blog/calc.html', {'a' :a},context_instance=RequestContext(request)) and dont show me that error,but not work again now if i touch calc button just reload dont show me error dont show me results only clear numbers why ? {% csrf_token %} Number of nu

Re: mathematical function and django connect

2016-02-21 Thread Luis Zárate
use render instead of render_to_response from django.shortcuts import render return render(request, 'blog/calc.html', { 'a' :a, }) 2016-02-21 22:57 GMT-06:00 Xristos Xristoou : > UserWarning: A {% csrf_token %} was used in a template, but the context > did not provide the val

Re: mathematical function and django connect

2016-02-21 Thread Xristos Xristoou
UserWarning: A {% csrf_token %} was used in a template, but the context did not provide the value. This is usually caused by not using RequestContext. Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical functio

Re: mathematical function and django connect

2016-02-21 Thread Xristos Xristoou
yes i see that and fix it but not work again Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical function on python idle, > i want to create website where the user import value numbers on the > function > and ta

Re: mathematical function and django connect

2016-02-20 Thread James Schneider
On Sat, Feb 20, 2016 at 11:50 PM, Xristos Xristoou wrote: > place csrf on my code > > > {% csrf_token %} > Number of number: > Enter a value: > > > > > and the background color from input is a differend and i take that message > > This inspection highlights form elements without require

Re: mathematical function and django connect

2016-02-20 Thread Xristos Xristoou
place csrf on my code {% csrf_token %} Number of number: Enter a value: and the background color from input is a differend and i take that message This inspection highlights form elements without required associated label (WCAG 2.0: H44

Re: mathematical function and django connect

2016-02-20 Thread James Schneider
On Sat, Feb 20, 2016 at 11:33 PM, Xristos Xristoou wrote: > i find solution for that error > > if i change request to : > > if 'nums' in request.POST: > nums = request.POST['nums'] > else: > nums = False > > > > now i have else error and i think the code in my html form is wrong > (inside

Re: mathematical function and django connect

2016-02-20 Thread James Schneider
On Sat, Feb 20, 2016 at 10:32 PM, Xristos Xristoou wrote: > i have a progress with help anyway i am newbie > > i convert my python script(remember the first script on the first page) to > django script on the view > > views.py: > > from django.shortcuts import render_to_response > def calc(reques

Re: mathematical function and django connect

2016-02-20 Thread Xristos Xristoou
i find solution for that error if i change request to : if 'nums' in request.POST: nums = request.POST['nums'] else: nums = False now i have else error and i think the code in my html form is wrong (inside the form i copy paste {% csrf_token %}) and again nothing Forbidden (403) CSR

Re: mathematical function and django connect

2016-02-20 Thread Xristos Xristoou
i have a progress with help anyway i am newbie i convert my python script(remember the first script on the first page) to django script on the view views.py: from django.shortcuts import render_to_response def calc(request): a = [] NList = [] y=0 nums = request.P

Re: mathematical function and django connect

2016-02-16 Thread Luis Zárate
What is wrong in your code? I suggested you some scripts changes that allows import and use in views. Help us to help you, give us more information about what are you doing, what are you planning to do? Why you think you code is wrong?. Did you create the view as I suggested? I think you need t

Re: mathematical function and django connect

2016-02-15 Thread James Schneider
On Tue, Feb 9, 2016 at 11:47 AM, Xristos Xristoou wrote: > hello, > > > i create some python mathematical function on python idle, > i want to create website where the user import value numbers on the > function > and take the results from that. > Usually this is done through a form. You can eit

Re: mathematical function and django connect

2016-02-15 Thread Xristos Xristoou
after read your toturial from the django docs and next page from the django docs i think so my python code is wrong to get in views.py, i think so get in form Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
I repeat you again OK, start with writing a view https://docs.djangoproject.com/en/1.9/intro/tutorial03/ Show something funny in your HTML and when you be able to see in your browser let me know. How to do that, see the tutorial, basically this are the steps create a django app (python manag

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
THNX for response to help me,two questions,how to import list input on my def math(input,*listinput*) how to define this ? now i dont have model,on my html template how to connect on my scipt ? Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > >

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
It's correct. A recomendation Try to get out all input() from the function, because django is a server side so user don't have a standard input. 2016-02-10 15:22 GMT-06:00 Xristos Xristoou : > if i dont want refactor my scipt,and use this > def my_math_func(input1,input2): > my code >

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
if i dont want refactor my scipt,and use this def my_math_func(input1,input2): my code return list_output,output is that correct ? Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical function on pyth

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
Maybe you need to refactor your script, I suggest you something like this: def my_math_func(your_input): your_input = your_input.replace(" ", "") # prevent "1, 2" list_input = [int(x) for x in your_input.split(",")] # others comprobations could be do list_output = [] for x in lis

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
for example: myscipt that my input for example the user define the number to want for input and next input integer numbers on the list(NList) that list go to progress and exported one variable result outpout and list of variables results. i dont upload the progress code because i think not is ne

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
OK, start with writing a view https://docs.djangoproject.com/en/1.9/intro/tutorial03/ Show something funny in your HTML and when you be able to see in your browser let me know. El miércoles, 10 de febrero de 2016, Xristos Xristoou escribió: > i dont know how to start to give you an example,is

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
i dont know how to start to give you an example,is confused i am newmbie and i dont find anythink on the internet Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical function on python idle, > i want to create w

Re: mathematical function and django connect

2016-02-10 Thread Luis Zárate
Someting like def myview(request): dev = mymathfunc(request. POST.get_list('mi_input', [])) return render(request, 'mytemplate.HTML', {'result': dev}) I am not sure if get_list it is a valid function, I know there is one that do the same, but can't remember how is called. If you can g

Re: mathematical function and django connect

2016-02-10 Thread Xristos Xristoou
yes i want this and work with python list for input and output Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical function on python idle, > i want to create website where the user import value numbers on the >

Re: mathematical function and django connect

2016-02-09 Thread Luis Zárate
I think you want to show a form with a text input where the user could insert some input eg. math equation to sent to the server. In the server you what to get the input and use it in the standard input of your script, in your script you made what you want (included input validation) finally the

Re: mathematical function and django connect

2016-02-09 Thread Xristos Xristoou
THNX for response but that toturial not answer on my questions Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical function on python idle, > i want to create website where the user import value numbers on the >

Re: mathematical function and django connect

2016-02-09 Thread Fabio C. Barrionuevo da Luz
these questions will be answered with the knowledge that you acquire after after completing the official tutorial: https://docs.djangoproject.com/en/1.9/intro/ and additionally, perhaps : http://masteringdjango.com/introduction/ or http://www.tangowithdjango.com/book17/ On Tue, Feb 9, 2016

Re: mathematical function and django connect

2016-02-09 Thread Xristos Xristoou
yeah my bad for the regext i know that with the full name btw,form its not nesecery to create ? my task is to copy paste my code in the view,create the regext,and connect on my templete ?only just ? hello, > > > i create some python mathematical function on python idle, > i want to create websi

Re: mathematical function and django connect

2016-02-09 Thread Xristos Xristoou
yeah my bad for the regext i know that with the full name btw,form its not nesecery to create ? my task is to copy paste my code in the view,create the regext,and cell on my templete ?only just ? Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, >

Re: mathematical function and django connect

2016-02-09 Thread Fabio C. Barrionuevo da Luz
https://en.wikipedia.org/wiki/Regular_expression https://docs.djangoproject.com/en/1.9/topics/http/urls/ https://regex101.com/#python On Tue, Feb 9, 2016 at 5:41 PM, Xristos Xristoou wrote: > what is regext? > > Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos > Xristoou

Re: mathematical function and django connect

2016-02-09 Thread Xristos Xristoou
what is regext? Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos Xristoou έγραψε: > > hello, > > > i create some python mathematical function on python idle, > i want to create website where the user import value numbers on the > function > and take the results from that. > q

Re: mathematical function and django connect

2016-02-09 Thread Sergiy Khohlov
Add regext to the url.py and view function to it Add function to the view.py accepted function values from request object and return value of your functions Create template which few input values field and shown result Many thanks, Serge +380 636150445 skype: skhohlov On Tue, Feb 9, 201