2008-3-29

23:23 Juanjo-sfe
in the view I am using render_to_response(template, vars_dict)
23:26 Juanjo-sfe
Magus-: could you help me?
23:26 Magus-
obviously not, or I'd be speaking
23:27 Juanjo-sfe
Magus-: i've told my parter here you'll response that, sorry
23:28 Juanjo-sfe
I really need help here
23:28 tbye
Juanjo-sfe: isn't the signature something like this for what you want? render_to_response(template, vars_dict, context_instance=ContextInstance)?
23:29 tbye
Juanjo-sfe use that... my context_instance=RequestContext(r)
23:29 tbye
where r is the request passed in
23:29 tbye
to the view method
23:31 andriijas
APPEND_SLASH = True is lame. it should be the other way around, django forcing no trailing slash
23:31 Magus-
now that's just silly
23:31 chrisdrackett
would it be silly to cache the currently logged in user?
23:32 andriijas
Magus-: why? do you even know where trailing slashes comes from?
23:32 andriijas
Magus-: the sick world of php
23:32 Magus-
roflmao
23:32 Magus-
how wrong are you
23:33 andriijas
if you hit http://foo.com/foo/bar you want the file bar, not http://foo.com/foo/bar/ which would mean, look for anything that the server wants to repsond with under the dir bar/
23:33 Magus-
it has nothing at all to do with php
23:33 Juanjo-sfe
tbye: maybe I am wrong, what I am supose to get at response.context? I was expecting the variables used to parse the tempalte
23:33 Magus-
and that's only true when serving it by a normal webserver, andriijas
23:34 andriijas
DirectoryIndex index.html blabla
23:34 tbye
Juanjo-sfe: that's what the vars_dict is
23:34 Juanjo-sfe
tbye: can I acces the vars dict from the response?
23:34 tbye
Juanjo-sfe You have to turn on support for RequestContext if you want it. I use it so I have access to logged in user creds and such automatically.
23:35 andriijas
Magus-: well i just think it would make more sense to get the file /foo/bar and not /foo/bar/ which in most cases means look for whatever the server ahs to serve in the dir /foo/bar/
23:35 Juanjo-sfe
tbye: how I turn it no?
23:35 tbye
sorry... maybe I'm misunderstanding what you're saying is the response. You mean access vars inside your template?
23:35 Juanjo-sfe
tbye: no, response = Client.get(url)
23:35 Juanjo-sfe
n testcassses
23:35 tie
andreaja: the trailing slashes are (were) used by webservers to denote a folder, rather than a file; it's what Apache calls Cannonical URLs
23:35 tbye
ahh
23:35 polpak
andriijas: urls have no notion of files or directories. they're just resources organized into a hierarchy
23:36 Juanjo-sfe
tbye: got me?
23:36 andriijas
polpak: exactly. and for SEO purposes it would be better to use /foo/bar rather than /foo/bar/
23:36 polpak
andriijas: I doubt that
23:36 polpak
andriijas: but if you feel that way, there's a very simple fix
23:36 tbye
Juanjo-sfe: I do... but I'm sorry... I'm not familiar enough with the response directly to help. I was thinking you were talking about the template rendering.
23:37 polpak
andriijas: set APPEND_SLASH=False
23:37 andriijas
i know
23:37 dcramer[]
damn working with subprocess sucks
23:37 andriijas
but everyone should use that
23:37 andriijas
:)
23:37 dcramer[]
my final solution to system calls: http://www.pastethat.com/ZP4cr
23:38 dcramer[]
anyone have a better way?
23:38 polpak
andriijas: fascism sucks
23:38 tie
andriijas: because of some SEO myth??
23:38 thief_grr
anyone has worked with django+latex?
23:38 brosner
23:38 andriijas
if you do wget http://foo/bar/ you will get an index.html, how insane is that? if you do wget http://foo/bar you get an file named bar, which is more proper
23:38 tie
andriijas: you are way off the mark
23:39 andriijas
:)
23:39 dcramer[]
brosner: probably shoulda looked for libs before i started, i assume dpythons werent a pita
23:39 dcramer[]
but i dont really need threading so its ok
23:39 dcramer[]
or is that just the threading api
23:39 brosner
dcramer[]: huh? it has *similar* interface to threading. it isn't threading
23:39 dcramer[]
ah
23:39 dcramer[]
password = shell.system_call(['mkpasswd', password], AccountUpdateError, "mkpasswd failed: %s")
23:39 dcramer[]
thats how mine works :)
23:40 brosner
23:40 emacsen
Oh great Magus- , can you tell me what I need to look at to figure out what's wrong: http://dpaste.com/42064/ ?
23:40 tie
andriijas: you ask a webserver to give you a resource (url) and it decides what the resource will be - it can return a directory index when you ask it for index.html or vice versa
23:41 polpak
dcramer[]: ... I don't understand why you're setting p1.returncode after you raise.. that will neither do anything, nor be in any way accessible later on
23:41 Magus-
andriijas: you're wrong in both cases there
23:41 brosner
dcramer[]: however, i think what you are trying to do and what processing is are two different things. my bad.
23:41 dcramer[]
polpak: it works fine, and its because its setting it to 0 even though there was an error
23:41 Magus-
emacsen: look at the definition for group() and how you're calling it
23:41 andriijas
Magus-: whatever. lets talk about django instead. my /admin/ throws an permanent redirect , why?
23:41 dcramer[]
which 0 means success as far as my understanding
23:41 Magus-
andriijas: how should I know?
23:42 emacsen
Magus-, all I'm calling is the admin interface login screen
23:42 andriijas
Magus-: because your the expert :D
23:42 trhaynes
I want to add some dynamically made charts from google charts into my site
23:43 trhaynes
where in django should I do the set up work. or, what information do I transfer between the view and template?
23:43 Magus-
andriijas: yes, btu you gave 0 info
23:43 emacsen
trhaynes, you can't run arbitrary python in your template
23:43 Magus-
trhaynes: what work? isn't the google chart api something you just stick in an image tag?
23:44 trhaynes
Magus-: well I'm using an API
23:44 trhaynes
so I guess I have to generate a URL in my view and then pass that to my template
23:44 emacsen
trhaynes, I might check that URL before passing it
23:45 trhaynes
check? how so
23:45 emacsen
or check what happens if the URL is bogus
23:45 emacsen
trhaynes, I'm saying what happens if the URL is bad for some reason, just be sure to account for that
23:45 emacsen
Magus-, So you have no idea what to check?
23:46 emacsen
all I'm doing is bringing up the admin interface
23:46 dcramer[]
i wonder if the people who write thee modules actually find them useful
23:46 dcramer[]
*these
23:47 andriijas
Magus-: i dunno. i surf into myrurl.com:9000/admin/ and it redirects me to myurl.com/admin/ myurl.com is a nginx with a proxypass to the django dev server running at port 8000
23:49 Juanjo-sfe
is posiblle from a testing enviroment get the variables used to parse a template for a givven url?
23:52 jlilly
Magus-: not sure if you were aware, but for future reference.. jacob created a template tag for gCharts which is pretty nice.
23:53 Juanjo-sfe
mmmmm
23:53 Juanjo-sfe
seems what I qas commenting
23:53 Juanjo-sfe
is a django known bug
23:54 Juanjo-sfe
23:55 tie
on a side note you could use a JS charting lib like Flot (http://code.google.com/p/flot/) - it looks much better than google charts (althoug it's quite limited yet)
23:56 mattmcc
jlilly: Is it djangosnippet-ed?
23:57 jlilly
mattmcc: I don't think so... http://toys.jacobian.org/hg/googlecharts/
23:57 Juanjo-sfe
Juanjo-sfe: an invalid bug
23:57 Juanjo-sfe
works from mange.py test but not from manage.py shell
23:57 Juanjo-sfe
weird...
Page 23 of 23   ← Previous  (2,299 total)