In my `views.py`, I have one path render an html file:

    def interactive(request):
    if request.session.get('interactiveID') == None:
    t= get_template('blank-interactive.html')
    else:
    interactive_template= 'interactive-' + str(request.session['id']) + 
'/index.html'
    t= get_template(interactive_template)
    
    return HttpResponse(t.render())

So `form.html` has an `<iframe>` that requests `/interactive`, and 
`request.session['id']` is set to `1`. When the iframe requests 
`/interactive`, it loads `interactive-1/index.html`. The iframe loads the 
HTML from that page, but cannot get the JS file at 
`interactive-1/scripts/main.js`. 

When I check the terminal, I see this 404 error: `GET 
/interactive/scripts/main.js`. If it would just load 
`/interactive-1/scripts/main.js`, there would be no problem. But Django 
loads `/interactive-1/index.html`, but not 
`/interactive-1/scripts/main.js`. Same goes for the CSS and image assets, 
which are in CSS and image folders.

What do I need to change in Django for it to correctly load the JS, CSS, 
images and other assets?

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/d94bfa19-0250-4a90-93be-63e18889cb53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to