Hello, may not be django related, assume I have a master view and a detail view within the same template, and the user created a successful entry. I'd like the redirected (to) template to show the record he created in the detail view. How would i approach such a thing? (Should i follow something similar to how messages work? Only on next request?)
zz_zobbo is now known as zobbo
Zeograd joined the channel
jrm2k6 joined the channel
julytwilight has quit
shredding has quit
shredding joined the channel
fesener_
guys i've deployed my website to heroku now but when i try to reach /admin/ it throws server error 500
anyone can help me ?
scott_w joined the channel
Fuyou
xterm well redirect to the detail view, i can't see a problem for now
mengu has quit
xterm
Fuyou: I can't think of a way to pass additional data while redirecting, since there's no context. I was thinking either session or query args.
(Doh, that would be 2 ways, but I'm not sure either is the correct way)
mengu joined the channel
radac joined the channel
Fuyou
xterm what additional data you need? I thought you need just new pk or slug depending on how you adress detail views
then would someone be as kind as to tell me what this means: A model is the single, definitive source of data about your data, I'm in the tutorial01 from the intro section and got confused with that line
BakaKuna joined the channel
fesener_
heroku keeps throwing error 500 pf
alexander__b
I have a client that wants to send POST to my django app. how do I do this? right now I just get "Origin null is not allowed by Access-Control-Allow-Origin"
bouke
darkmutt: something along these lines, if you have a model named 'Dog', than this Dog model should be the only source about the Dog info. Thus, store everything related to Dogs in this model / instances.
encc joined the channel
pydonny has quit
darkmutt
ok that makes more sense, thanks bouke :)
dnikolai joined the channel
margle joined the channel
geaden_ joined the channel
bouke
From the documentation I'm using the TimezoneMiddleware. Everything is working fine, expect well… it's a HUGE performance drain. I've been doing some ab-testing, and the results made me sad (concurrency=2):
without timezone.activate: 15,5 ms per request (128 req/s)
with timezone.activate: 273,9 ms per request (7,6 req/s)
darkmutt
why in da heck would timezone take that much all by itself?
shredding
I want to inspect what's written when into the test_database, but pgadmin always shows me an empty table.
merb joined the channel
bouke
(note: this is on a server running through nginx/gunicorn and without any other load on the machine)
shredding
Is the data just written in memory?
md4d joined the channel
LordVan joined the channel
pydanny has quit
twoface
bouke, it must depend on what you are doing with the timezone, since the middleware from the documentation only saves a value in a local()
twoface: hmm yes, that's true. Why wouldn't the normal timezone machinery not slow things down, using the default timezone definition? It just needs to do the same things, but just using a different timezone...
shredding
Fuyou: I'm doing a model.foreignmodel_set.add(foreignmodel) and want to know if all changes that I made to foreignmodel will be persisted or if just the foreign key will be added. After debugging the add() method, i guess, all changes will be persisted (that would be good) but I'd like to see it in the db to be sure.
JainAmber joined the channel
twoface
bouke, i have no idea - perhaps try to remove stuff from your view bit-by-bit to find out what takes such a long time
or use some profiling tools
rolleiflex joined the channel
shredding
Is there an attribute on the model that i can observe wether all changes have been persisted? I guess so, but can't find it.
apollo13
no, aside from .pk, but that's only for the first save
shredding
ok ...
pydonny joined the channel
bouke
twoface: I'd really like to profile things; but profiling django is a pain and the tools aren't any better :(
shredding
well, the add() methods calls obj.save(), so all data should make it.
apollo13
bouke: hu? profiling django isn't that hard
twoface
bouke, i've had quite some success using profiling middleware
shredding
(Still does not explain why my test database is always empty).
twoface: benching with `ab -c 2 -n 1000 -C "sessionid=XXX" http://10.179.131.135/` and the outcome is consistent with previous outcomes. The only thing I'm changing inbetween benchmarks is commenting out the timezone middleware and restarting gunicorn.