django does not open html file properly

31 views
Skip to first unread message

qop

unread,
Apr 27, 2018, 12:33:20 PM4/27/18
to Django users
Hi guys!
I've created some graphics with gephi using the sigma exporter plugin which creates a project like this one, for use the interactive graphic it's just needed open the index.html Now i've created a little site with django and i'd like to show the interactive graphics that i've generated by gephi on my site: i've created a button in this way:

<li><a target="_blank" href="./gephi/1/1/network/index.html">1.1 - OpenOrd - Centrality</a></li>

in the network folder there are all the files generated from gephi, but i can't open properly the project by django, infact when i open the index.html appears only this.
In the urlpatterns in urls.py i've added this:

path('gephi/1/1/network/index.html', views.graph)

in the view.py i've added this:

def graph(request): return render(request, 'home/gephi/1/1/network/index.html', {})

 what am i doing wrong?
this is the tree

Andy

unread,
Apr 27, 2018, 5:24:43 PM4/27/18
to Django users
It looks as if you see all contents of you index.html while also missing all dependencies .. check the network tab of your browser to confirm this.
The report created by gephi is probably an html page that is soppused to be opened via the browser directly or served with a webserver. Just rendering the page through Django wont fix included styles sheets of needed javascript tags.

You should setup a docker nginx, mount your report into its html root folder and link there from your django app.
What you are trying to do sounds to complicated. Dont try to push the reports through Django. You might rather build a catalogue listing all the reports, but for actually showing them, use an nginx docker.

qop

unread,
Apr 30, 2018, 10:06:29 AM4/30/18
to Django users
You are right, it's too complicated.
I could zip gephi's graphics and make them downloadable on my site, how could i do that?
How can i create a "download button" that allows the user to download my zip files?

Andy Grabow

unread,
May 1, 2018, 9:25:37 AM5/1/18
to django...@googlegroups.com
Like I said: setup an nginx docker and save the reports in its base folder. Then link there from your Django app. Save yourself trouble of zipping, downloading unzipping and manually opening the reports!

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/aWDr0VYIj-4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@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/265f121b-d7e2-4517-a6d9-199ca7ed6d4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Mit besten Grüßen
Andy

Reply all
Reply to author
Forward
0 new messages