#django

/

      • jessamynsmith has quit
      • apiarian joined the channel
      • mattmcc
        Colliding?
      • Ariel_Calzada joined the channel
      • dheerajchand
        What’s up everyone?
      • shogundynamite joined the channel
      • raijin joined the channel
      • blackcross
        #django
      • woops
      • shogundynamite
        Hi guys, I want to start using Sass for a django project of mine that I've been working on for a few years? Whats the best way to about doing this?
      • Olajyd has quit
      • staticshock
        shogundynamite: heroku, elasticbeanstalk?
      • Coldblackice joined the channel
      • shogundynamite
        Linode VPS
      • blackcross
        So I have this javascript function: https://dpaste.de/sRVw and the response I am using is "return JsonResponse({'purchased': True})" how do I properly find out if purchased is set to True in javascript? I thought data['purchased'] would be correct, but it does not seem to be.
      • staticshock
        shogundynamite: oh, i misread your question
      • mattmcc
        shogundynamite: Asset managers like django-compressor or django-pipeline might be helpful.
      • madprops has quit
      • zujko joined the channel
      • shogundynamite
        mattmcc: I saw some of those but the ones I found weren't very popular, I'll check out them out now.
      • dcrouch has quit
      • blackcross
        found out why, i didn't have the d in purchased :(
      • zujko has quit
      • what is the pep standard for naming variables/json like that? just use present tense always?
      • guess i should use {'success':True} or {'success':False} would be best, so it will be universal
      • dheerajchand
        Hey, so I can write a query on the model tables in PSQL, but I am having trouble translating to the Django ORM. Anyone mind helping? https://dpaste.de/pv5s
      • coulix_tap joined the channel
      • citizen-stig joined the channel
      • zujko joined the channel
      • zujko has quit
      • Olajyd joined the channel
      • citizen-stig has quit
      • Leeds joined the channel
      • tobz has quit
      • shogundynamite has quit
      • govg_ has quit
      • mattmcc
        dheerajchand: Crime.objects.values('ward').annotate(cc=Count('pk')).values('ward', 'cc')
      • hive-mind joined the channel
      • dheerajchand
        mattmcc: Do you mind if I deconstruct that and walk my way through it with you?
      • mattmcc
        It produces essentially the same query.
      • You can see the result by doing qs = ^; print qs.query
      • dang`r`us
        vyscond, not redis ... django session
      • dheerajchand
        For all Crime objects, using the value of the field called `ward` as a key, create a value called `cc` that is a Count of all primary keys in that grouping, then show a list of JSON, where the property:value are ward: ward_id, cc: cc
      • vyscond
        what?
      • raijin has quit
      • mattmcc
        dang`r`us: What do you mean by collisions?
      • dang`r`us
        nevermind, I'll get back to that issue once I solve everything else here
      • okay so real quick
      • mattmcc, request.session is more or less a dictionary, right? so, when putting something in there, should I prefix my key with my.app.fqdn or something?
      • to avoid stepping on others
      • nirakara joined the channel
      • mattmcc
        Oh. If you're worried about your keys being overly generic, I suppose it'd be prudent.
      • Like I probably wouldn't set request.session['data']
      • dang`r`us
        yup yup
      • this
      • dcrouch joined the channel
      • dheerajchand
        mattmcc: I tried readin the documentation for the aggregate/annotate functions and it was just Esperanto to me
      • Your example made it more clear
      • dang`r`us
        guess I'll prefix stuff with myappname-
      • dheerajchand
        Any chance you can refer me to a really idiot level tutorial?
      • dang`r`us
        should be safe enough
      • dcrouch has quit
      • hive-mind has quit
      • vyscond has quit
      • hive-mind joined the channel
      • madprops joined the channel
      • whaack joined the channel
      • vibepositive has quit
      • Olajyd has quit
      • TodPunk joined the channel
      • whaack has quit
      • Olajyd joined the channel
      • nirakara joined the channel
      • mihow has quit
      • mandeep has quit
      • arlekin
        here i have interesting problem guys - probaly wrong channel to ask it, but if someone could point me where should i seek support than would be quite enough
      • so here goes...
      • jessamynsmith joined the channel
      • i want to allow users to create their avatars
      • by selecting various options
      • stacked on top of one another as layers
      • for instance bottom layer would be heads with different skin colours
      • then few different faces
      • then hair on top of that
      • i have few - let say - sprite's grids for that
      • and through simple css modifications im aligning them within some viewport
      • to create final image
      • but i'd like to store resulting avatar as flat picture
      • for displaying it on subsequent occassions
      • and i wonder how can i achieve that
      • any ideas ?
      • dang`r`us
        that sounds like a job for <canvas>
      • MarkusH
        arlekin: so, once a user is happy with what they chose, you submit that information to your Django application on do the overlay there
      • arlekin
        MarkusH: so basically you are sayin i should send offsets and do same thing on the server side ?
      • dang`r`us: could you elaborate, im not familiar with <canvas>
      • MarkusH
        arlekin: that's what I'd probably do. No idea if there's any front end side way to create the image
      • MarkusH neither
      • dang`r`us
        well <canvas> is for bitmap manipulation basically.
      • it's almost 5am here so not giving a detailed intro .....
      • but you can goooogle it.
      • MarkusH
      • arlekin
        dang`r`us: same here, im not asking for tutorial ;) just wanted some hook
      • i'll look into canvas then
      • MarkusH: you don't know perchance any lib for such gluing layers of pictures in python ?
      • MarkusH
        arlekin: pillow
      • that does *all* the image magic in python
      • former PIL
      • arlekin
        MarkusH: reference to imagemagic intended or not ?
      • Jameswine joined the channel
      • MarkusH
        kind of
      • arlekin
        i see, i'll into that either then
      • Jameswine
        If I have files that people are downloading from my website, what is the best way to handle generation and serving? Right now we have a downloads folder that gets zipped and cleaned for each set of files generated.
      • darkxploit joined the channel
      • dang`r`us
        if you use canvas you probably won't need pillow
      • I mean it all depends a bit on your use case but personally I would probably compose it all in the browser, just using canvas
      • arlekin
        i guess the perfect thing would be to kinda "screenshot" content of designated div
      • dang`r`us: the composing part is easy, since i already have my grids and its matter of moveing <img>'s, i worry about producing result though
      • MarkusH
        arlekin: use the toDataURL() on canvas and send the data off to Django
      • djapo joined the channel
      • Jameswine: have a look at x-sendfile
      • Olajyd has quit
      • arlekin
        canvas looks promising since it has method for drawing images on it, so if i figure out how to use part of image i should be golden
      • Olajyd joined the channel
      • for future reference, who should i ask for such things ? #web-design or something ?
      • yoongkang has quit
      • btw thanks MarkusH dang`r`us, you've been of great help
      • Ariel_Calzada has quit
      • gotta love irc - saves your butt when you don't necessary have weeks/eternity for waiting for answer on SO ;)
      • dang`r`us
        :V
      • dang`r`us off to bed
      • arlekin
        'night
      • djapo has quit
      • george2 has quit
      • george2 joined the channel
      • MarkusH
        arlekin: you're welcome
      • zujko joined the channel
      • yomilk joined the channel
      • yomilk has quit
      • yomilk joined the channel
      • mmalone joined the channel
      • whaack joined the channel
      • T0rch has quit
      • garrypolley joined the channel
      • whaack has quit
      • jtri joined the channel
      • tyris has quit
      • jtri
        is there a way to render something like this in a view: render_to_response('django.contrib.auth.views.login', {'template_name': 'login.html'}) ?
      • MarkusH
        jtri: what are you trying to accomplish?
      • jtri
        MarkusH: avoid using the url pattenr to specify everything...