Sunday, February 28, 2016

Re: Integrate appliction into Django

In addition, I am not sure you have to use Django here; a simpler Python web-framework like Flask might be more suited (there you don't have to have models; just views). 

You could write a view that loads the text file and converts it (via a jinja template) into an HTML table, for example.  This page in turn could be linked to a view that loads the file, converts it to CSV (?) and then returns that to the browser - most modern browsers would either allow the user to download the file, or offer to open it in Excel/LibreOffice. 

I would assume the plots are in standard PNG or JPEG format and could be displayed directly via img tags. 

There are lots of code examples for Flask, so if you Google around, you are likely to find bits-and-pieces you can reuse.

On Sunday, 28 February 2016 14:50:30 UTC+2, Alain Muls wrote:
Hi All,

I made a program that creates 4 plots and text files about the location of GNSS (Global Navigation Satellite Systems) based on TLEs downloaded from NORAD.

I would like  to use this program in django (I started with edge-django as my template). But I don't know how to start with it. How would I define a model/view for displaying the plots and text files and how can I allow users to download these results?

Thanks for your help
Alain

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/db48cb35-1abb-42e7-9580-65454aea9a2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment