Or you can render the js file as if it was a template.
Put the javascript in a template directory.

In the main HTML, change the tag to something like <script href='/
myapp/jscript/renderMaps/'>

In your "urls.py" add something like

('/myapp/jscript/renderMaps','myapp.views.rendermap')

then in your views.py create a view:

def rendermap(request):
    # create the variables you need here
    var1 = "Hello"
    address = Address.objects.get(id=1)
   :
    return render_to_response('renderMaps.js', locals(),
RequestContext(request))

You can see the idea, anyhow!


On Nov 25, 11:25 am, Alessandro Candini <cand...@meeo.it> wrote:
> Hi everybody.
>
> I have an application with the following structure:
>
> STO
> ├── __init__.py
> ├── jsonopenlayers
> │ ├── __init__.py
> │ ├── models.py
> │ ├── static
> │ │ ├── css
> │ │ │ └── STO.css
> │ │ └── js
> │ │ └── renderMaps.js
> │ ├── tests.py
> │ └── views.py
> ├── manage.py
> ├── settings.py
> ├── templates
> │ └── jsonopenlayers
> │ └── index.html
> └── urls.py
>
> Static files are found, but I have the problem that inside renderMaps.js
> I have some Django template tag to be interpreted.
> How can I tell Django to parse also that, in addition to my index.html?
>
> Thanks in advance.
>
> --
> Alessandro Candini
> MEEO S.r.l.
> Via Saragat 9
> I-44122 Ferrara, Italy
> Tel: +39 0532 1861501
> Fax: +39 0532 1861637http://www.meeo.it
>
> ========================================
> "ATTENZIONE:le informazioni contenute in questo messaggio sono
> da considerarsi confidenziali ed il loro utilizzo è riservato unicamente
> al destinatario sopra indicato. Chi dovesse ricevere questo messaggio
> per errore è tenuto ad informare il mittente ed a rimuoverlo
> definitivamente da ogni supporto elettronico o cartaceo."
>
> "WARNING:This message contains confidential and/or proprietary
> information which may be subject to privilege or immunity and which
> is intended for use of its addressee only. Should you receive this
> message in error, you are kindly requested to inform the sender and
> to definitively remove it from any paper or electronic format."

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to