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