#django

/

      • xterm
        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
      • pydonny has quit
      • felix89 has quit
      • sagarchalise joined the channel
      • mengu has quit
      • felix89 joined the channel
      • pydonny joined the channel
      • jarshwah has quit
      • pydanny joined the channel
      • knite has quit
      • hyperair has quit
      • mengu joined the channel
      • corehook joined the channel
      • bouke joined the channel
      • darkmutt joined the channel
      • dnikolai has quit
      • darkmutt
        hey guys i've got a question is the docs.djangoproject.com the official site?
      • bouke
        anyone here experienced with timezone (USE_TZ)?
      • darkmutt: yes; that's the official docs
      • hyperair joined the channel
      • hyperair has quit
      • darkmutt
        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()
      • sagarchalise has quit
      • rolleiflex has quit
      • Fuyou
        shredding are you reffering to this ? https://docs.djangoproject.com/en/1.5/topics/te...
      • shredding
        Fuyou: Yes.
      • It's not in memory, but i can't access the data.
      • domino14 has quit
      • nihilista joined the channel
      • bouke
        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).
      • swi joined the channel
      • Fuyou
        shredding >>>https://docs.djangoproject.com/en/1.5/topics/testing/overview/#the-test-database
      • "Regardless of whether the tests pass or fail, the test databases are destroyed when all the tests have been executed."
      • shredding
        Fuyou: I have read that, i have set a breakpoint within a test.
      • Whatever, i just do a Mymodel.objects.all() and look for it.
      • tsurantino has quit
      • Stierlitz joined the channel
      • jhgaylor joined the channel
      • H25 joined the channel
      • Sevrius joined the channel
      • radac has quit
      • kristallpirat joined the channel
      • kezabelle joined the channel
      • Narsilou joined the channel
      • Narsilou has quit
      • jscott1989 has quit
      • darkmutt
        hi uhm i got to part 2 of tutorial in here https://docs.djangoproject.com/en/dev/intro/tut... but there's nothing displayed in /admin site, any advices would be quite helpful??
      • endra has quit
      • Narsilou joined the channel
      • Left_Turn joined the channel
      • void has quit
      • marek_sv joined the channel
      • nvm,sorry got the wrong version for the tut
      • kushal has quit
      • marek_sv has left the channel
      • DanielSamuels joined the channel
      • jscott1989 joined the channel
      • jhgaylor has quit
      • fesener_ has quit
      • xterm has quit
      • hypolin has quit
      • zenoamaro joined the channel
      • yuwang has quit
      • hypolin joined the channel
      • yuwang joined the channel
      • primski joined the channel
      • kushal joined the channel
      • jangoh has quit
      • syst3ml00t has quit
      • JainAmber has quit
      • fpk^away is now known as flashingpumpkin
      • bojo_ joined the channel
      • kl4us joined the channel
      • ragsagar has quit
      • JainAmber joined the channel
      • bojo has quit
      • Fuyou
        can I invoke model instance method from ValueQuerySet ?
      • kushal has quit
      • endra joined the channel
      • greg_f joined the channel
      • crazydiamond joined the channel
      • reran joined the channel
      • Relaed has quit
      • dkostyszak joined the channel
      • bee_keeper joined the channel
      • bouke
        twoface: tried profiling with cProfile and hotshot; but from their output, there doesn't seem to be a difference. See https://dpaste.de/ns1ct/ and https://dpaste.de/pCxCi/.
      • reran has quit
      • jangoh joined the channel
      • twoface
        bouke, perhaps your benchmarking was wrong?
      • Leeds joined the channel
      • pydanny joined the channel
      • bouke
        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.
      • t3r5354t joined the channel
      • quetz joined the channel
      • kevinbrolly joined the channel
      • dkostyszak has quit
      • TeeTime joined the channel
      • bullicon joined the channel