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.

Did you find this post useful? Show some love!
DISCUSSION
Classic DEV Post from May 20

What kind of breaks do you take throughout the work day?

...

Jaydeep Borkar
I'm a Computer Engineering student at University of Pune, India. Implementing my skills to build products that can help people and our environment across the globe is what that drives me.

How well do you know your own code?

Sign up (for free)