2008-3-2

22:51 Uz_
inside a template, I'd do http://{{ site.domain }}{% url view args %}
22:53 Uz_ says good night
22:54 yuji
Uz_ thanks!
22:55 yuji
Where do I set the sites domain/name? (django.contrib.sites.models) -- I don't suppose I should do it from the shell.
22:56 Uz_
yuji: usually you have SITE_ID in settings.py .. and can set the domain name etc via django admin / dbshell / shell
22:58 yuji
Yes I noticed it has that setting, but the Admin panel only lets you add domain/name_of_site with mystery IDs. I will go from shell. thanks for all the help!
23:03 mariorz
how would you do a cit lookup in the templates when you have the key in a var?
23:03 mariorz
dict*
23:05 __machine
i have apache at the front and apache at the back... after i logout... if i type in the url to a page i had been to previously that is restricted to authenticated users... i can see the page again instead of being asked to login...
23:06 __machine
it seems to be coming directly from the browsers cache... i have mod_expires on the front (static) server set to expire static content in 1 week...
23:06 __machine
would that affect a redirect?
23:10 elsigh
man, I wish I could debug _ - all I can get is the msgid I pass in - how is anyone supposed to figure out wtf when that happens?
23:10 elsigh
anyone know how I might go about that?
23:10 elsigh
I've tried --verbosity=2
23:11 elsigh
pdb?
23:11 implor
you can write "python manage.py shell" to interact in the terminal but how do you use IDLE?
23:12 mattmcc
Just have your DJANGO_SETTINGS_MODULE set when you run it..
23:14 __machine
it seems that it does... why would apache set an expires tag on a redirect? how can i tell it not to?
23:17 yuji
I'm having trouble having {{ site.domain }} return anything. What do I need to have a view render {{ site.domain }}?
23:17 elsigh
pdb not helping either
23:19 elsigh
should gettext work in the django-admin shell?
23:21 elsigh
(I should've given up on this hours ago ;)
23:23 __machine
ExpiresByType only sets by mime type right... not by response (http302 moved)
23:26 smitten_by_djang
anyone using nginx with apache mod python for serving a django site?
23:27 FunkyBob
I thought nginx had its own mod_python?
23:27 natim
I have a question about the administration
23:27 natim
When you use edit_inline
23:27 natim
I will try to explain you ...
23:28 anteatersa
nginx for serving static files smitten?
23:28 smitten_by_djang
Funky: dont know the details of nginx, but was trying to follow the guidline at http://www.lethain.com/entry/2007/jul/17/dreami... and I am having a problem
23:29 smitten_by_djang
anteateras: yeap...are you using it?
23:29 AzMoo
So I've gotten around the functionality of limit_choices_to by defining the queryset in the init of my form, but does anybody know if there's a reason why the patch to fix it hasn't been accepted? It doesn't say in the comments. Is it being removed or something?
23:29 natim
23:29 anteatersa
no I was just looking into using lighttpd for static files
23:30 natim
To extends an Model
23:30 natim
The ForeignKey with the unique=True option
23:30 Townk
anyone here use mptt and sites on the same model?
23:30 natim
In this case I would like to have everything in the same administration part
23:31 natim
So I tried with edit_inline but it doesn't seams to work
23:31 FunkyBob
natim: why not a one-to-one relation?
23:32 FunkyBob
ah... edit_inline doesn't work with o2o ... so there's one reason :)
23:32 FunkyBob
natim: at some point you just have to accept... the admin is not your app...
23:32 natim
Because I though it was not recommended
23:32 FunkyBob
natim: it can only go so far... eventually you have to write your own interface
23:32 natim
Ok
23:33 smitten_by_djang
anteatersa: did you succeed? I was not able to setup the lighttpd properly, so I was trying nginx....
23:33 FunkyBob
natim: of course, all this changes when newforms-admin merges, but ... well... :)
23:33 natim
Ok
23:33 anteatersa
well I have it running on my local pc..... just testing at the mo
23:33 FunkyBob
smitten_by_djang: I was using lighttpd for some time, using FastCGI...
23:34 anteatersa
easy to install on ubuntu
23:34 FunkyBob
smitten_by_djang: decided it was too finnicky
23:34 anteatersa
I don't like the way configuration is all done in one file
23:34 Husio
someone familiar with MochiKit and/or javascript?
23:34 Husio
I'm getting JSON data, that looks like this: {"msg": null, "valid": false, "errors": {"message": ["To pole jest wymagane."]}} and then I'm using evalJSONRequest to create JS object. But error_obj['errors'].length is giving me `undefined`. What's wrong?
23:35 brehaut
objects dont have length
23:35 brehaut
only arrays
23:35 Husio
do'h, so I need to change the view
23:35 Husio
thanks
23:35 anteatersa
FunkyBob .. what are you using now?
23:35 brehaut
no worries
23:36 FunkyBob
brehaut: that would have been my first thought
23:36 FunkyBob
anteatersa: I'm migrating to Apache/mod_wsgi
23:36 FunkyBob
have two servers using that config now... am quite pleased
23:36 clayning
I have a DateTimeField attribute that I'm updating in a custom save() method like so:
23:36 clayning
self.expires = datetime.utcnow() + timedelta(0, self.lifetime)
23:37 anteatersa
I am thinking of going that way myself.... my apache instances are like 100mb of mem each using mod_python
23:37 smitten_by_djang
funkybob: so you are not using lighttpd anymore? and what is apache/mod_wsgi?
23:37 clayning
that adds self.lifetime seconds to the current time in the command interpreter, but in django it seems to add self.lifetime hours. anyone know why?
23:41 anteatersa
smitten .... you don't know what mod_wsgi and you are now installing nginx
23:44 elsigh
ok, I can experience this straight from a new project now - and I don't understand..
23:44 elsigh
I create a new project
23:44 elsigh
run make-messages.py, and create a django.po for en
23:44 elsigh
compile-messages.py
23:44 elsigh
and then python manage.py shell
23:45 maple
i have two models (Event, Participant). Events have a 'open_seats' field. When I add a participant to an Event is there a way to decrese the event.open_seats by one? -- trying this in the Participant Model but not working
23:45 maple
def save(self):
23:45 maple
if not self.id:
23:45 elsigh
from django.utils.translation import ugettext as _
23:45 maple
self.event.open_seats = self.event.open_seats - 1
23:45 maple
super(Particiapnt, self).save()
23:45 elsigh
print _('test') # which I've defined a translation for
23:45 elsigh
and all I get is 'test
23:46 elsigh
so shouldn't that work?
23:49 smitten_by_djang
anteatersa: no, I dont know about mod_wsgi... actually, I know very little about server configuration... you also recommend mod_wsgi?
23:53 FunkyBob
smitten_by_djang: I have lighttpd on some legacy boxes
23:55 anteatersa
well apparently mod_wsgi uses less memory
23:56 smitten_by_djang
anteatersa & Funky: is it easy to setup mod_wsgi on ubuntu?
23:57 anteatersa
should be quite easy
23:57 FunkyBob
smitten_by_djang: I found it easy to set up on Debian
23:57 FunkyBob
so, yes, should be quite easy
23:58 smitten_by_djang
anteatersa & Funky: do you remember the instructions you followed? a link, perhaps... instead of googling myself crazy....
23:59 wolfe
DJ ango :P
23:59 wolfe
stupid rails people :/
23:59 FunkyBob
well, I normally start from the Django documentation...
23:59 FunkyBob
wolfe: ?
23:59 FunkyBob
smitten_by_djang: also, the mod_wsgi docs are quite good
23:59 wolfe
FunkyBob: this rails vs django ad
Page 17 of 17   ← Previous  (1,698 total)