Can you drop a Python script into Satchmo?

8 views
Skip to first unread message

jc

unread,
Nov 11, 2011, 6:15:48 PM11/11/11
to satchm...@googlegroups.com
Hi,

Is it possible to drop a Python script (around 50 lines) into one of your Satchmo pages? Would this be embedding into the template code? I am experimenting with doing this but I haven't had any luck in finding out how.

Thanks again,
Jimmy

Stuart Laughlin

unread,
Nov 11, 2011, 6:24:01 PM11/11/11
to satchm...@googlegroups.com
Can you please elaborate on what you are trying to achieve? It sounds
like maybe you want a template context processor, but I can't be sure
based on your description.


Thanks,

--Stuart

> --
> You received this message because you are subscribed to the Google Groups
> "Satchmo users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/satchmo-users/-/CuQjDwYYjbYJ.
> To post to this group, send email to satchm...@googlegroups.com.
> To unsubscribe from this group, send email to
> satchmo-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/satchmo-users?hl=en.
>

Dave Brown

unread,
Nov 11, 2011, 7:06:47 PM11/11/11
to satchm...@googlegroups.com
Or perhaps a template tag? 
--
Dave Brown
CEO/Founder
Rampframe.com - Action Sports Network

jc

unread,
Nov 11, 2011, 7:41:17 PM11/11/11
to satchm...@googlegroups.com
Oh hi. :)

An example of what I am wanted to try out is placing a script like this http://www.goldb.org/ystockquote.html and see if I can't drop it into a page like this http://demo.satchmoproject.com/category/book/fiction/ and have it print out some info on the page.

lzantal

unread,
Nov 11, 2011, 7:50:46 PM11/11/11
to satchm...@googlegroups.com
Hmm, you would use a view for that and then a template to display the data.
Or write a templatetag to return the most recent one.

lzantal



On Nov 11, 2011, at 4:41 PM, jc wrote:

Oh hi. :)

An example of what I am wanted to try out is placing a script like this http://www.goldb.org/ystockquote.html and see if I can't drop it into a page like this http://demo.satchmoproject.com/category/book/fiction/ and have it print out some info on the page.

--
You received this message because you are subscribed to the Google Groups "Satchmo users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/satchmo-users/-/0qDFQv638xAJ.

jc

unread,
Nov 11, 2011, 8:58:14 PM11/11/11
to satchm...@googlegroups.com
Okay, a view and a template tag. I will start reading more on this via the Django site and see if I can make it work.

thanks!
jimmy

Dave Brown

unread,
Nov 11, 2011, 9:04:55 PM11/11/11
to satchm...@googlegroups.com
a view OR a template tag.  good luck!  
Also, you may find even more help (and faster feedback) asking directly to the #django irc channel since there are only a few people in the satchmo email group (compared to the django irc channel), and what your trying to do isn't specific to satchmo.

and as I previously said, i'll repeat again, when you look at the django docs, make sure your reading the correct version of docs for what you have installed, theres nothing like trying to figure out why something doesn't work when following documentation that is outdated :)

Dave

--
You received this message because you are subscribed to the Google Groups "Satchmo users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/satchmo-users/-/CL5nzKfUvm0J.

To post to this group, send email to satchm...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.

jc

unread,
Nov 12, 2011, 5:28:29 AM11/12/11
to satchm...@googlegroups.com
Thanks, I will try #django and the their website to find out how I might do this...first thing that comes to mind is once I have the script in the page how will I call it? didn't think of that...harder than I thought. :) ..will read docs and ask on irc..

thanks all!
jimmy

Dave Brown

unread,
Nov 12, 2011, 6:51:38 AM11/12/11
to satchm...@googlegroups.com
Jimmy,
The script isn't actually 'in' the html or template (as in loaded to the client).  It is referenced (or called) from the template (if using a template tag) or called before you load the template, and the data passed to the template (if using a view).

You may find it will save you a lot of time and headache if you put this current project aside for a short while and do a few tutorials first and build a few demo apps to get a feel of how things work in the framework. 

Dave


jimmy

--
You received this message because you are subscribed to the Google Groups "Satchmo users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/satchmo-users/-/zQ_Vba49LZwJ.

To post to this group, send email to satchm...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.
Reply all
Reply to author
Forward
0 new messages