#django

/

      • karanlyons
        Django defers queries and connections as long as possible, so there shouldn't be any spawned unless you're actually evaluating something db backed somewhere.
      • nanonyme
        The Lua logic can failover to Django
      • dcrouch joined the channel
      • karanlyons
        That's a possible solution, but you're just running around the mountain when there may be an easy tunnel through it.
      • antranigv joined the channel
      • knbk
        techdragon: you can override Model.clean()
      • nanonyme
        karanlyons, well, using nginx+Lua will likely scale better
      • newke joined the channel
      • siovene joined the channel
      • karanlyons
        Probably, yeah, but that's a different problem for if you're running into performance issues of execution.
      • siovene
        Hello. I'm trying to use django-nose for coverage, but when I use it as TEST_RUNNER, tests won't start due to an import error: http://dpaste.com/3WT002M
      • nanonyme
        And allows you to use normal worker logic for Django (which is more predictable)
      • robattila256 joined the channel
      • siovene
        Any idea? Tests of course work fine without nose.
      • m_30_m
        unfortunately my server is under heavy load right now so can't turn logging on. I should test it tomorrow morning
      • FreedomFighter has quit
      • karanlyons
        nanonyme: Wait, are these workers spawning up inside a request/response cycle?
      • m_30_m: Can you repro locally?
      • nanonyme
        karanlyons, I doubt it
      • karanlyons
        So then what's the normal worker logic point you were making?
      • m_30_m
        karanlyons: It's not easy and I'd rather run it exactly on the server causing the problem
      • nanonyme
        karanlyons, eventlet workers may result in your application logic blocking at surprising points
      • josuebrunel has quit
      • m_30_m
        My main reason for using async was that there was a need to make an api call on some of the requests and the server latency was pretty awful
      • nanonyme
        Having massive concurrency in nginx and having regular Django workers basically gives best of both worlds. Assuming you know how to write Lua
      • m_30_m
        nanonyme: I know lua but the logic is pretty hard to write it in Lua
      • Gnjurac joined the channel
      • karanlyons
        nanonyme: Ah, I was kinda assuming you're aware of what will and won't block.
      • m_30_m
        Do you guys suggest anything else as a solution?
      • knbk
        siovene: what django version is that? looks pretty old
      • nanonyme
        karanlyons, I'm basically planning on taking advantage of this at work if I ever get the time to refactor logic
      • karanlyons
        I've got a bunch of gevent workers under Celery, and they're doing Django work but are mostly just Python
      • Some redis stuff for speed and to avoid hitting the db unnecessarily.
      • Gnjurac
        hi i am still learning phyton am half trou, anwey i just want to make an webpage that takes the text from some EditableLine and procces it and when finish gives a file to client depending on text, i am newb to web development so can this be done with Django?
      • nanonyme
        That is, implement some API's both as normal Django and writing a Lua variant where I then add the Lua variant into nginx to replace Django variant where possible
      • josuebrunel joined the channel
      • siovene
        knbk: yes it's old. It's 1.4.
      • d3vnull has quit
      • knbk: don't tell me to upgrade. I need to write tests before I can upgrade :-)
      • nanonyme
        I'm expecting the system should then be able to scale across our company's expansion needs with a single server
      • knbk
        I won't ;) Just needed the version to make sure I check the right code
      • 1.4 EOL wasn't that long ago anywya
      • siovene
        knbk: I stepped into it with a debugger, and it looks like while it's trying to import "astrobin.s3utils" which should be right, the correct import would be astrobin.astrobin.s3utils. I don't believe that's correct tho. The first astrobin would be the project name, and the second would be an app name.
      • My source code, if you would like to peek around: https://bitbucket.org/siovene/astrobin/src
      • djapo has quit
      • knbk
        siovene: can you print sys.path in your manage.py?
      • m_30_m
        nanonyme: karanlyons: thanks for your help!
      • siovene
        knbk: sure
      • josuebrunel has quit
      • knbk
        siovene: gotta go, dinner's ready, but good luck :)
      • siovene
        knbk: thanks!
      • Gnjurac
        thanks for naswer
      • knbk has quit
      • jnoob22 joined the channel
      • josuebrunel joined the channel
      • tiagoboldt has quit
      • m_30_m has left the channel
      • pupil has quit
      • josuebrunel has quit
      • av_ has quit
      • stole joined the channel
      • stole
        If I accidentally cleared the entire django_migrations table, is there any way to recover?
      • Just the contents of it.
      • xterm joined the channel
      • josuebrunel joined the channel
      • SpoutBE
        of course, your backup ^^
      • stole
        oh yeah. backup.
      • Gnjurac has left the channel
      • karanlyons
        You can manually recreate it, too.
      • sayan joined the channel
      • As long as you know what your last applied migrations were for all your apps.
      • Or create a new db, run all the migrations on it, and then clone the migrations table.
      • stole
        I can. The reason I'm asking, is because I encounter this: http://stackoverflow.com/questions/30545562/dja...
      • karanlyons
        It's just pk, timestamp, migration name.
      • I'm guessing 0002_remove_content_type_name somehow ran without being logged.
      • stole
        It suggest altering a table with the missing field, but it doesn't seem quite right for me.
      • karanlyons
        That's fine, you're going to add a column to be immediately removed.
      • I'm making some assumptions here as to what happened to you, to be sure.
      • stole
        Sounds fine then. Thanks!
      • By the way, I am in development mode and I expect to be for some time still. Is there a way to completely reset the project and it's database? Reconstruct everything?
      • I read about manage.py flush, although it says in the documentaiton that it does not achieve a 'fresh install' state.
      • karanlyons
        Completely rest?
      • s/rest/reset/
      • I usually just drop the database and recreate it, and rerun the migrations.
      • Ensures that everything is reset, and also that it's reset to what Django is expecting.
      • stole
        Sounds perfect.
      • karanlyons
        If doing that breaks something, you know your migrations have fallen out of sync somehow.
      • newke has quit
      • newke joined the channel
      • canton joined the channel
      • realnot joined the channel
      • peterrus has quit
      • codeme has quit
      • BlindHunter has quit
      • Lobstaman3 joined the channel
      • frege joined the channel
      • frege
        when I'm using DRF for auth, I get error for CSRF
      • how should I handle that?
      • I'm not using a form to POST
      • I'm using the API endpoint and doing a POT with json
      • eperzhand joined the channel
      • ubuntu_aze joined the channel
      • Lobstaman3 has quit
      • josuebrunel joined the channel
      • newke has quit
      • bcSquared joined the channel
      • silverfix joined the channel
      • telboon has quit
      • asoliman joined the channel
      • gopar joined the channel
      • DLSteve joined the channel
      • GearHead08 joined the channel
      • anyone?
      • GearHead08
        Hi Frege
      • frege
        hi
      • commx has quit
      • GearHead08
        frege: i might have joined the channel after you asked something, not sure if i can help
      • frege
        [15:24] <frege> when I'm using DRF for auth, I get error for CSRF [15:24] <frege> how should I handle that? [15:24] <frege> I'm not using a form to POST [15:24] <frege> I'm using the API endpoint and doing a POT with json [15:47] <frege> anyone?
      • lanshark has quit
      • GearHead08
        frege: Ah, sorry...a bit out of my realm of knowledge. I'm still just getting my feet wet with Django/Python.
      • sanketdg has quit
      • CandyApples has quit
      • Genitrust has quit
      • Genitrust joined the channel
      • keimlink joined the channel
      • jtri joined the channel
      • jtri
        hello, is field_ids a special key in the context of a form?
      • I'm reading some code that sets the ocntext in the view, and I'm trying to add one field which is hidden but also has the value set... can't quite figure it out
      • year8000 joined the channel
      • codeme joined the channel
      • shpladaow joined the channel
      • codeme has quit
      • dray3 joined the channel
      • codeme joined the channel
      • codeme has quit
      • lordzero joined the channel
      • fission6 has quit
      • fthuin joined the channel
      • lordzero
        evening all. im jus getting my head wrapped around Django and am publishing it to Azure as a WebApp. Looks like the static files aren't loading and was wondering if anyone knew what I need to do to get it working? I'm publishing out of VS
      • fthuin
        Hello everyone ! I need some help on a for loop.. I don't get how I have to do to load a staticfile in an img ( http://dpaste.com/1JDP7V6 )
      • GearHead08
        Hey lordzero
      • lordzero
        Hey GearHead08
      • DLSteve has quit
      • GearHead08
        lordzero: i'm relatively new to django as well, but isn't there some sort of collectstatic command that's supposed to be used?
      • lordzero
        from what I've read Azure moves the static files around or something of the sort
      • GearHead08
        Hmmm
      • A bit out of my league then I'm afraid :( sorry.
      • lordzero
        no worries. i appreciate it :)