#django

/

      • Leeds joined the channel
      • eperzhand joined the channel
      • Troy2 joined the channel
      • eshlox has quit
      • jessamynsmith
        I am sorry to hear that, pdehaye2017
      • cellofellow has left the channel
      • Diemuzi has quit
      • jtiai^ joined the channel
      • busla joined the channel
      • orf_ has quit
      • busla has quit
      • dlam has quit
      • jtiai^ has quit
      • kreative has quit
      • Ryanar has quit
      • eperzhand has quit
      • sphrak
        jnerula: https://dpaste.de/k2Dk these are the serializers
      • dodobrain has quit
      • I think it is because I have location as a m2m relationship
      • sol1x has quit
      • Troy2 joined the channel
      • stridebird1 joined the channel
      • dirgeable_ has quit
      • stridebird has quit
      • stridebird1 is now known as stridebird
      • miz- has quit
      • busla joined the channel
      • mcards55 joined the channel
      • spacecadetbrown joined the channel
      • busla has quit
      • jnerula: https://dpaste.de/eSbO#L7,9,15,17,27,29,35,37 these are the offending lines, it shouldnt encapsulate it in [] nor add that extra "point"
      • the_rat joined the channel
      • spacecadetbrown has quit
      • Xiti has quit
      • Xiti joined the channel
      • donatas has quit
      • lolidunno has quit
      • netheranthem has quit
      • jhfisc joined the channel
      • the_rat has quit
      • lolidunno joined the channel
      • jhfisc has quit
      • busla joined the channel
      • busla has quit
      • rodolfojcj joined the channel
      • rodolfojcj
        hello everybody
      • bayman joined the channel
      • jhfisc joined the channel
      • Chef_Gromboli joined the channel
      • sobersabre has quit
      • I'm trying to test a POST request, but I don't know how to pass the 'Authorization' header
      • dang`r`us
        use the same content as an authorized browser's cookie
      • rodolfojcj
        I did something like this snippet ...
      • sobersabre joined the channel
      • but I always get 401 http status code in the response
      • What could be wrong?
      • FunkyBob
        myclient.post('/logout/', HTTP_AUTHORIZATION="Token 7753b87a72832dd8c35a7550e5a498cc365a5443"} )
      • rodolfojcj
        I'll try....
      • bayman has quit
      • jhfisc has quit
      • jhfisc joined the channel
      • re1 has quit
      • FunkyBob: you gave me the right hint! Actually the line would be like this: myclient.post('/logout/', {}, HTTP_AUTHORIZATION='Token 7753b87a72832dd8c35a7550e5a498cc365a5443')
      • thank you!
      • delgiudices joined the channel
      • I read the Django test client docs, but I misunderstood the given example
      • jhfisc has quit
      • Is it Ok to assume that http headers are always sent in uppercase and starting with 'HTTP_' ??
      • at least to assume it when using django test client ?
      • hutch34 has quit
      • FunkyBob
        yes, it's ok... because we still haven't shrugged off the shackles of CGI :(
      • bsically, you pass that stuff in the same format as it will appear in request.META
      • rodolfojcj
        ookk!
      • jtiai^ joined the channel
      • thanks a lot FunkyBob! Now I can end my end with a small victory :)
      • * end my day
      • FunkyBob
        huzzah!
      • we just went through a trial approval process for our MVP
      • I've already fixed all the bugs uncovered
      • before the meeting even finished :P
      • sphrak
        Neat FunkyBob :D
      • FunkyBob
        did I mention I realy like how django-nap has turned out? :)
      • busla joined the channel
      • cyphase joined the channel
      • sphrak
        you committed some token example yesterday iirc?
      • busla has quit
      • sms
        Funky going HARD
      • jtiai^ has quit
      • FunkyBob
        sphrak: ok, nap-token-auth ? not sur why I called that nap :P
      • it's in no way restricted to django-nap
      • we used it to deal with CORS stupidity in IE
      • sphrak
        FunkyBob: yes :)
      • FunkyBob
        could not get the magic recipe to make it post cookies... so we sent an Auth bearer token instead
      • sphrak
        gah why does this code produce an extra point block? https://dpaste.de/CKuH#L38
      • dal220 has quit
      • dodoopop joined the channel
      • pwrentch has quit
      • jhfisc joined the channel
      • Troy2 joined the channel
      • jhfisc has quit
      • jhfisc joined the channel
      • busla joined the channel
      • solomonix has quit
      • busla has quit
      • jhfisc has quit
      • mcspud
        FunkyBob talk to me about this MVP
      • wedgie
        Anyone have any guidance on how to handle storing recurring scheduled tasks? Espeically with regard to daylight savings and not getting an hour ahead/behind when that happens. I realize that this may be a quite involved topic so a link may be the best answer... i haven't been able to find anything particulary useful on my own
      • jessamynsmith
        wedgie: I'm not quite sure I know what you mean. I use cron to schedule tasks.
      • mcspud
        wedgie - anything that is UTC timezone aware will automatically update the timestamp so you should be fine
      • wedgie
        jessamynsmith: well, these would be events that a user schedules. For example, send a reminder every day at 8am. I don't want to convert to UTC and store that way becuase when a daylight savings transition occurs, it'll be an hour off
      • mcspud
        wedgie - based on that, you can set recurring tasks with celery that follow a schedule based on the systime, which should be timezone aware
      • spacecadetbrown joined the channel
      • wedgie
        mcspud: well, it doesn't matter what the system's local time is, it will matter what the user's local time is.
      • mcspud
        literally the entire point of timezone aware to make time consistent across changes like daylight sayings
      • wedgie
        so it kinda feels like it should be stored in the user's local time... but that sounds like it has it's own issues
      • mcspud
        saving*
      • jessamynsmith
        I'm pretty sure you want to save it in UTC and also save what the user's timezone is
      • wedgie
        mcspud: quite new to django so maybe i'm overthinking things. Is there some magic built in that just handles this stuff?
      • mcspud
        yes, UTC timezones
      • ^_^
      • wedgie
        what do i need to google to read up on that?
      • mcspud
        How are you going to schedule your tasks?
      • wedgie
        heh, that's what I'm trying to decide. In the very early planning phase so i'm VERY open to suggestions :)
      • mcspud
        celery is the most commonly used django task runner
      • I'd recommend that
      • spacecadetbrown has quit
      • busla joined the channel
      • Info-Screen has quit
      • Info-Screen joined the channel
      • tsukasa_ joined the channel
      • busla has quit
      • jarshwah
      • you can't just rely on utc and timezones, especially for user local time scheduled tasks
      • you have to store the users local timezone, and the time in that local timezone that you want to execute
      • mcspud
        wut
      • why
      • jarshwah
        scheduled tasks in local time are about the only case where utc + timezone does not work
      • mcspud
        If a user registers a task for `08:00:0000+11`, and the users timezone goes to +12... oh I see
      • But doesn't that mean you need to store their locale?
      • jarshwah
        offsets are not timezones :P
      • mcspud
        yeah
      • I dun goofed
      • tau has quit
      • jarshwah
        also, timezone definitions can change between the time you stored the event, and the time the event occurs
      • tau joined the channel
      • that's the really tricky bit to handle
      • the best way I can think of is..
      • tau has quit
      • every X (minute, hour?) .. check if any tasks, converted to current UTC match current UTC.. execute if so