DEV Community

Jaydeep Borkar
Jaydeep Borkar

Posted on

How to embed graph in Django for the users

I want to show a graph(using matplotlib) to the user. In which Django directory should I place my code?

mysite/

graph/
my_matplotlib/
init.py
my_matplotlib.py
graphcode.py (basically, the code for the graph)

app/
views.py
from my_matplotlib.my_matplotlib import my_func

my_matplotlib.py

def my_func():
foo = 'bar'
return foo

I tried this but it's not working.

Top comments (1)

Collapse
 
danielm profile image
Daniel Mejía Raigosa

Hey, did you managed to make this work?