Django, JavaScript, Python, HTML &Co. : Print on html a variable running on python file

142 views
Skip to first unread message

Beatrice Galvani

unread,
Apr 16, 2015, 11:40:39 AM4/16/15
to django...@googlegroups.com
Hi, I'm using Django 1.7.2, Python 3.4.

My trouble is: I have a simple function in some directory written in python (e.g. a counter since 0 to 10); I would like to see these numbers on my monitor on the HTML page.. I know how start the function but I am not able to print the variables!  

My formatted question is HERE on Stack Overflow.

I hope someone can help me , I do not know how to proceed.
Thanks

Marc Patermann

unread,
Apr 20, 2015, 4:26:35 AM4/20/15
to django...@googlegroups.com
Beatrice,

Beatrice Galvani schrieb (16.04.2015 17:34 Uhr):
> Hi, I'm using Django 1.7.2, Python 3.4.
>
> My trouble is: I have a simple function in some directory written in
> python (e.g. a counter since 0 to 10); I would like to see these numbers
> on my monitor on the HTML page.. I know how start the function but I am
> not able to print the variables!
>
> My formatted question is *HERE on Stack Overflow
> <http://stackoverflow.com/questions/29624611/django-javascript-co-print-on-html-a-variable-running-on-python-file>.*
>
> I hope someone can help me , I do not know how to proceed.
noramlly you have a template for an URL.
The template is generated by a view.
Views are python functions.
- You should call your python function from a view, the function must
return your variable to the view function.
- The view should return your variable to the template.
- The template should be able to display your variable.


Marc
Reply all
Reply to author
Forward
0 new messages