#django

/

      • Ruzzy joined the channel
      • Ruzzy
        oi
      • FunkyBob
        oi oi oi!
      • ams__ has quit
      • the_rat joined the channel
      • tulioz joined the channel
      • Ruzzy
        :D
      • two questions not that djangoey. is it appropriate to strip png metadata for web use, and is it appropriate to convert jpeg compress photos that have a small amount of non-photo graphics on them?
      • I have a bunch of huge images begging for some compression but they have just a bit of stuff drawn over them.
      • reisio
        if you don't mind the occasional artefact, it's roughly as good to use JPEG for things that are mostly photographic as it is to use JPEG for things that are all photographic
      • I would definitely strip metadata always if you aren't using it
      • and inform people you aren't if you are using it
      • woltman joined the channel
      • metadata is a privacy issue timebomb
      • the_rat has quit
      • Ruzzy
        m
      • reisio
        the ideal way to have a bit of stuff drawn over what is otherwise 99% a single photograph, though, would be for the photograph and overdrawing to be separate
      • mstrcnvs joined the channel
      • mstrcnvs
        halo
      • I'm using Django with uWSGI and whenever there's an exception with some accent in the message thrown I get 502 bad gateway
      • already tried to set utf-8 in uWSGI and Django, any clues?
      • FunkyBob
        mstrcnvs: stop being lazy with mixing str and unicode?
      • Ruzzy
        reisio: that's a good idea. I'll get our graphics person to separate them if the compression looks like it obliterates the extra stuff
      • mstrcnvs
        FunkyBob: not sure if I understood
      • I'm using py3
      • Koterpillar
        mstrcnvs: look closer at the exception and fix it, it's not uWSGI
      • reisio
        Ruzzy: or just if you have the time at all :p
      • mstrcnvs
        why? I want accents in the exception message, it's part of my language and it changes meaning
      • Ruzzy
        it's just more markup I will need to add ;__;
      • reisio: ^
      • FunkyBob
        mstrcnvs: well, what sort of errors are you getting?
      • Koterpillar
        mstrcnvs: aah, I see! Are you getting anything other than a 502? Another exception while throwing that exception?
      • mstrcnvs
        FunkyBob: UnicodeEncodeError: 'ascii' codec can't encode character '\xe7' in position 15: ordinal not in range(128)
      • FunkyBob
        right
      • you certain you're using py3?
      • mstrcnvs
        502 bad gateway is because uWSGi seems to crash and nginx can't connect anymore
      • FunkyBob
        because that looks like py2 auto-encoding errors
      • Koterpillar
        ^ ++
      • mstrcnvs
        let me paste the traceback
      • FunkyBob
        as in, _exactly_ like
      • mstrcnvs
        it's from /usr/lib/python3.4/logging/ module
      • just a sec
      • Ruzzy
        how come optipngs man page and help flag both don't mention the strip flag?
      • holler
        how can I fix create user form for User model that uses email not username? http://dpaste.com/184E87T
      • Ruzzy
        is there somewhere else I should be looking? some tutorials show it being used
      • FunkyBob
        Ruzzy: you're using ubuntiu, right?
      • Ruzzy
        yeah
      • FunkyBob
        last I saw they ship an ancient version of optipng
      • zfjohnny joined the channel
      • Ruzzy
        darn
      • FunkyBob
        here's a nickle, kid... get y'self a real OS :P
      • Ruzzy
        ;__;
      • zfjohnny
        Newbie question here: I’ve just joined a django team with a medium sized codebase. when I’m in debug mode and I edit a python file, django reloads as advertised. However, it takes 12 seconds before the site is functional every time I edit a python file. Am I doing something wrong here?
      • FunkyBob
        zfjohnny: your code probably does a lot of work on import/ready
      • mstrcnvs
        wow
      • mattmcc
        Or system checks are taking some time.
      • jarshwah_
        12 seconds is a long time!
      • mstrcnvs
        that's a lot
      • zfjohnny
        yeah.. i think this is a case of pepole just being used to things performing like shit and nobody doing anything about it and it getting gradually worse over time
      • mstrcnvs
        but you can disable auto-reload if it fits your needs
      • FunkyBob
        how long does "python manage.py check" take?
      • zfjohnny
        ill try that one sec..
      • jas02 joined the channel
      • real0m4.828s
      • user0m3.818s
      • sys0m0.993s
      • so basically 5 seconds.
      • how long does it usually take on a sane project?
      • c17r_ has quit
      • legostormtroopr joined the channel
      • FunkyBob
        that seems ok
      • mmxx_th has quit
      • mstrcnvs
      • moldy
        rixx: turns out that apparently my cache is using a different redis "bucket" for some reason
      • whatever that is :p
      • jas02 has quit
      • mstrcnvs
        don't know why it's trying to print the exception...
      • FunkyBob
        well, I wonder what file is at that point
      • Koterpillar
        yeah, logging config?
      • jobelenus has quit
      • mmxx_th joined the channel
      • SecondForm_Glenn has quit
      • mstrcnvs
        FunkyBob, Koterpillar: http://hastebin.com/muxugixeqe.py
      • cnk has left the channel
      • nothing unusual I think
      • phiofx joined the channel
      • Koterpillar
        mstrcnvs: locale.getpreferredencoding()?
      • zfjohnny has quit
      • mstrcnvs
        should I do that in the remote shell?
      • Koterpillar
        mstrcnvs: ideally in the same process environment as the server
      • mstrcnvs
        yes right
      • FunkyBob
        no accents or whatever in BASE_DIR ?
      • mstrcnvs
        nope
      • ironfroggy joined the channel
      • Koterpillar
        and try passing 'encoding': 'UTF-8' to that handler, perhaps?
      • Fayheavy is now known as hellno
      • Bryson has quit
      • mstrcnvs
      • re1 joined the channel
      • Koterpillar
        mstrcnvs: okaaaay, if encoding for handler doesn't work, that idea was wrong
      • mstrcnvs
        didn't try that
      • if the whole thing is unicode, shouldn't it just work?
      • SimpleName joined the channel
      • I'm trying more obscure possibilites like, uWSGI was compiled on python 2
      • but not sure how do I check that
      • Koterpillar
        well, uWSGI might be resetting your environment
      • mstrcnvs
        found, --python-version, but that's not it
      • it's python 3.4.3 as expected
      • Koterpillar
        can you output getpreferredencoding() from a _view_ ?
      • ejb has quit
      • mstrcnvs
        live production site, I do not have a staging one
      • will that a look at how I will proceed with this
      • DebianTUX joined the channel
      • transit joined the channel
      • Koterpillar
        since it's a plain FileHandler, the only way this will not work is if open() was getting the default encoding as ASCII
      • anyway, adding 'encoding' wouldn't _harm_
      • FunkyBob
        anyone know how to make curl dump the _full_ request it sends?
      • jas02 joined the channel
      • Koterpillar
        FunkyBob: there's always tcpdump
      • FunkyBob
        --trace-ascii
      • SimpleName has quit
      • mstrcnvs
        Koterpillar: encoding on the logging config?
      • DrCuriosity
        Koterpillar: mitmproxy / mitmdump also.
      • jas02 has quit
      • toc has quit
      • Koterpillar
        mstrcnvs: yes, next to the 'filename'
      • legostormtroopr has quit
      • fission6 has quit
      • FunkyBob: httpie can do this (--verbose)
      • FunkyBob
        Koterpillar: I have curl installed
      • garrypolley has quit
      • tulioz has quit
      • Koterpillar
        turns out the same option works!
      • Rialynn has quit
      • SimpleName joined the channel
      • mstrcnvs
        Koterpillar: that didn't work
      • not sure where to look anymore...
      • Koterpillar
        (11:26:29) FunkyBob: well, I wonder what file is at that point
      • disturbedmime has quit
      • mstrcnvs
        sorry, what does that mean?
      • Koterpillar
        'file' in the traceback, is it a regular file or something else?
      • nikivi joined the channel
      • mstrcnvs
        from where the exception is being emmited you say?
      • Koterpillar
        oh, wait, maybe it's sys.stderr that's the issue
      • mstrcnvs is lost
      • my working hypothesis is that sys.stderr is open with 'ascii' encoding
      • that might be due to uwsgi opening it, or not; I'm not familiar with it
      • mstrcnvs
        shouldn't it use the preferred encoding?
      • Koterpillar
        sys.stderr uses os.environ['PYTHONIOENCODING'] or 'utf-8'
      • CAPITANOOO joined the channel