How to embed graph in Django for the users

github logo ・1 min read

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.

twitter logo DISCUSS
Classic DEV Post from Nov 9 '18

Things Nobody Told Me About Being a Software Engineer

My dad started teaching me Basic when I was about 7 years old, and since about ...

Jaydeep Borkar profile image
I'm a third-year Computer Engineering student at University of Pune, India. I play around NLP and daydream the rest of the time.

dev.to has dark mode.

Go to the "misc" section of your settings and select night theme ❤️