Forums

How to use FusionCharts in Django project

I'm new to PythonAnyWhere and Django. I'm developing a simple Django project where data samples (fed from a sensor/Rasberry Pi) are stored in a MySQL table. Now I need to develop a view showing those data in a chart.

I'm considering FusionCharts, which comes with a Django wrapper, so it seems the perfect choice. I'm reading the installation instructions, but I'm not sure I understand them.

Is there anyone here using the FusionCharts Django wrapper who can clarify me what steps are needed to integrate it in my Django project on PythonAnyWhere?

Cheers!

I finally managed to have it work. First I installed a local version of django on my PC to try it out. I downloaded Django Charts (that is the django-wrapper) from here. This is the only download you need, it provides all the basic functionality. Should you need some more advanced functionality, you would probably need to download the entire library (fusioncharts or, if you need even more, fusionmaps) from here.

The downloaded zip file (django-wrapper-master.zip) contains a folder named django-wrapper-master, with a manage.py file in it. Inside that folder there is a fusioncharts subfolder, that is a sample django app demoing Django Charts.

I ran $ python manage.py runserver on my local machine to test it. Looking at urls.py and the sample *.py files in the samples subfolder, as well as the index.html template file, I understood what the readme file in the Github repository points out.

So I uploaded the file django-wrapper-master/fusioncharts/fusioncharts.py in my app directory on PythonAnywhere, and I also uploaded the entire folder django-wrapper-master/fusioncharts/templates/static/fusioncharts in the static folder of my project. These are the only things you need to upload, all other files are just examples. Then you can develop your views and templates following the examples.

That's great -- thanks for sharing!