How to use Marzipano 360 media viewer in Django project?

350 Views Asked by At

I've got a Marzipano sample with all the necessary files and folders. When I open index.html a 360 viewer runs in the browser and everything works fine.

Now I want to get the same thing working inside of Django project.

The directory structure for Marzipano sample looks this:

vendor/
tiles/
   img/
   data.js
   index.html
   index.js
   styles.css

The only folder I care is tiles, which has many folders with images.

To get this working in Django I have to put those images in the right place in the static folder of Django project.

I tried to figure out where exactly inside of JavaScript files the image paths are set, but unfortunately I have very poor knowledge of JavaScript.

I would be grateful for any advice.

1

There are 1 best solutions below

0
Negotiare On

If anyone ever comes across this problem, one way to solve it is through web server configuration. I am working with nginx and I could open a 360 viewer at desired URL by using 'location' directive:

location /gallery-360/ {
    root home/user/project;
}

This way there is no need to deal with Django urls, views and static files issues.