This solution makes a lot of sense!
On Tuesday, April 12, 2011 at 1:06:55 AM UTC-5, Sam Walters wrote:
>
> I mis-read this... basically you have one view and in the template you
> are rendering you put HTML:
>
>
>
>
>
> so that path will call your other views which return content as
> content_ty
On Apr 14, 5:48 am, nai wrote:
> Thanks for your help.
>
> I went with 2 views, 1 for the image and 1 for the html.
>
> On Apr 12, 2:06 pm, Sam Walters wrote:
> > I mis-read this... basically you have one view and in the template you
> > are rendering you put HTML:
>
> >
> >
>
> > so that path
Thanks for your help.
I went with 2 views, 1 for the image and 1 for the html.
On Apr 12, 2:06 pm, Sam Walters wrote:
> I mis-read this... basically you have one view and in the template you
> are rendering you put HTML:
>
>
>
>
> so that path will call your other views which return content as
On Apr 11, 1:21 pm, nai wrote:
> Is there anyway I can return the image like this `return
> render_to_response('template.html', {'graph': matplotlib or some other graphing package>}`
As noted, images are almost always loaded independently. See, for
example, "Definition and Usage" of img tag her
I mis-read this... basically you have one view and in the template you
are rendering you put HTML:
so that path will call your other views which return content as
content_type='image/png' or whatever specific format you're using.
what i was suggesting is you could have:
So in your urls.p
Hi
How about one view that takes arguments as either POST or GET params?
> You have to bear with me but where does background come from? So I can
> use the save() method from the PIL library is that right?
Ok so you can load a canvas.
Just to illustrate here is a view that puts dots on a map *m
You have to bear with me but where does background come from? So I can
use the save() method from the PIL library is that right?
And I can do something like this:
return render_to_response('template.html', {'graph':response})
Where graph is just a variable in my django template (and not )
Is th
Actually, could you illustrate how you would go about using 2 views as
well? Thanks!
On Apr 11, 6:39 pm, Xavier Ordoquy wrote:
> Le 11 avr. 2011 à 12:21, nai a écrit :
>
>
>
>
>
>
>
>
>
> > This is the give example from Matplotlib for Django:
>
> > def simple(request):
> > import random
>
> >
Use python imaging:
http://www.pythonware.com/products/pil/
You can return a response with an image of the graph.
response = HttpResponse(status=200, mimetype="image/gif")
background.save(response, "GIF")
return response
There is no 'best practice for this' Some people i know use flash.
However
One reason why I don't quite like the idea is because I am writing a
reporting webapp and there are many different graphs that can
generated. Needing to write 2 views for 1 type of graph can get pretty
tedious!
On Apr 11, 6:39 pm, Xavier Ordoquy wrote:
> Le 11 avr. 2011 à 12:21, nai a écrit :
>
>
I will try to the 2 views method and see how I get on but in it would
be great if you could answer my questions too!
Why does it go against best practices?
How would one go about doing it anyway?
On Apr 11, 6:39 pm, Xavier Ordoquy wrote:
> Le 11 avr. 2011 à 12:21, nai a écrit :
>
>
>
>
>
>
>
On Apr 11, 12:39 pm, Xavier Ordoquy wrote:
> Le 11 avr. 2011 à 12:21, nai a écrit :>
>
> > This is the give example from Matplotlib for Django:
>
> > def simple(request):
> > import random
>
> > from matplotlib.backends.backend_agg import FigureCanvasAgg as
> > FigureCanvas
> > from matp
Le 11 avr. 2011 à 12:21, nai a écrit :
> This is the give example from Matplotlib for Django:
>
> def simple(request):
>import random
>
>from matplotlib.backends.backend_agg import FigureCanvasAgg as
> FigureCanvas
>from matplotlib.figure import Figure
>from matplotlib.dates imp
This is the give example from Matplotlib for Django:
def simple(request):
import random
from matplotlib.backends.backend_agg import FigureCanvasAgg as
FigureCanvas
from matplotlib.figure import Figure
from matplotlib.dates import DateFormatter
fig=Figure()
ax=fig.add_subp
14 matches
Mail list logo