#django

/

      • joet joined the channel
      • kezabelle
        Basti_BRG: there's still one Release Blocker
      • beyond that, shrug
      • Basti_BRG
        thank's heaps!
      • efkin has quit
      • efkin joined the channel
      • lwm459 joined the channel
      • aavrug joined the channel
      • FunkyBob
        The final release is on schedule for Monday, August 1.
      • though they're running out of time :)
      • shangxiao
      • __jwe__ joined the channel
      • roostertank_ has left the channel
      • roostertank_ joined the channel
      • dodobas
        Laba: ahahaha :)
      • shangxiao: then I also could not go home :/
      • shangxiao
        dodobas: oh no you go home and tell them you're recording them so they can't run amok
      • or tell them since they only did 1/2 of what you asked, you only pay them 1/2 the money :)
      • stavros0x00 joined the channel
      • oh there's even a PR for that remaining release blocker
      • Basti_BRG
        just looked at the PR ;) It seems there was a fugly solution at first ;)
      • dodobas
        shangxiao: and then thay sue me for harassment :)
      • shangxiao
        sue them for dereliction of duty or something ;)
      • ironfroggy joined the channel
      • dodobas
        shangxiao: there is still hope, maybe someday ... they embrace the responosibility, maybe ... :)
      • idwaker joined the channel
      • X-virus joined the channel
      • mike_papa joined the channel
      • mike_papa
        Hello. I just created app "main" in my project. It has a simple "hellow world" type view, and nothing else in it. Django complains "django.core.exceptions.ImproperlyConfigured: 'main.apps.AppConfig' must supply a name attribute."
      • shangxiao
        mike_papa: did you create the app using `./manage.py startapp` ?
      • mike_papa
        I've never touched apps.py file, and it has MainConfig class in it with name attribute set to "main"
      • shangxiao: Yes.
      • Django 1.9.6
      • shangxiao
        mike_papa: can you dpaste.de the code + full traceback?
      • vmonteco joined the channel
      • mike_papa
        shangxiao: Sure. Give me sec please.
      • vmonteco
        Hello!
      • mike_papa
        shangxiao: Here is code: https://dpaste.de/Zv6E (I have touched only views.py - no other files were ever edited)
      • shangxiao: Here is full traceback: https://dpaste.de/tyuL
      • Could name "main" be in conflict with anything?
      • and intalled apps in settings looks like this: https://dpaste.de/3WcP
      • Couldn't get more simple
      • falk0n joined the channel
      • vmonteco
        I'm trying to set up nginx to serve a Django project. I found this conf file : http://bit.ly/2aFqV1Q But I don't get how the wsgi.py file is used in it.
      • iivvoo
        anyone here using huey as taskrunner?
      • mike_papa
        Oh... sorry. I did edit urls. But it doesn't look like urls problem.
      • vmonteco
        (When using it I get a 400 : bad request)
      • iivvoo
        I have the impression huey completely halts when a crontab tasks raises an exception
      • jtiai
        vmonteco: You need something to serve django. Like uwsgi or gunicorn.
      • iivvoo
        but I can't really reproduce this in a minimal non-django setup because huey won't even run any tasks there (but does pick them up)
      • jtiai
        vmonteco: That example actually seem to use uwsgi, so you need to configure uwsgi to serve django
      • jarshwah
        mike_papa: main.apps.AppConfig should be main.apps.MainConfig
      • vmonteco
        jtiai: I installed uwsgi and copied the uwsgi_params file into my project, but is the wsgi.py file used from uwsgi or from nginx? AFAIR, with apache, I gave a reference to my wsgi.py file in my apache conf files.
      • jtiai
        vmonteco: uwsgi. nginx just proxies requests to uwsgi.
      • mike_papa
        jarshwah: Thanks. Code completition makes me so lazy sometimes, and I overlook those small things.
      • Works good now.
      • jarshwah
        it happens :) no problem
      • peibolvig joined the channel
      • vmonteco
        jtiai: Ok, so if I understand well, I must configure uwsgi to pass those requests to the wsgi.py file?
      • jarshwah
        I've been meaning to write a blog post (and setup a blog to do so..) explaining an "easy" way of deploying django on uwsgi + nginx
      • vmonteco: gimme one minute, I'll give you a gist
      • shangxiao
        Funky Bob already has a easy django + uwsgi + nginx deployment blog post ;P
      • Leeds has quit
      • govg joined the channel
      • jarshwah
        he does?
      • do you know his site?
      • vmonteco opens duckduckgo.
      • shangxiao
      • jarshwah
        ta
      • vmonteco
        shangxiao: I'll check this! Thank you. :)
      • shangxiao
        nw :)
      • well thank Funky Bob by signing up for DO with his referral code
      • vmonteco
        (DO?))
      • shangxiao
        Digital Ocean
      • sebcorbin is now known as zz_sebcorbin
      • jtiai
        vmonteco: That page you linked contains complete example.
      • anddam
        I also like pythonanywhere for deployment
      • Y04NN joined the channel
      • edigiacomo has quit
      • that's how it should actually be, IMHO
      • edigiacomo joined the channel
      • vmonteco
        jtiai: I don't understand everything in it :S
      • Quitta joined the channel
      • lumidify has quit
      • azuri5 has quit
      • lacrymology joined the channel
      • Quitta has quit
      • iceboxx joined the channel
      • jarshwah
      • vmonteco
        jarshwah: Thank you! I'll check this out too. :)
      • Leeds joined the channel
      • ksuresh joined the channel
      • iceboxx
        hi, i have a requirement where i need to call os level commands like file copy, move, rename etc from a web application., are there any frameworks on the web that i can leverage ?
      • fleetfox
        automation?
      • johnmilton has quit
      • look at ansilbe/salt
      • t0n1c
        hi totally django noob, I was wondering if there is some way to treat templates as a scaffold where you can build more powerful apps? is that even within the Django philosophy?
      • fleetfox
        t0n1c: no, django achieves everything with composition. No code generation
      • jarshwah
        shangxiao FunkyBob good guide up until I got to "We'll be running uWSGI in emperor mode."
      • t0n1c
        fleetfox: interesting, what do you mean by composition? some article where I can check that?
      • jarshwah
        my "protip" is to install uwsgi into the virtualenv, then use the init system to launch it
      • emperor mode sucks for automation if you're running multiple sites under different pythons
      • fleetfox
        t0n1c: you have inheritance and overloading for templates, why do you want to scaffold anything
      • shangxiao
        interesting
      • jarshwah
        however, I run redhat not debian.. so maybe you can selectively bring in both python2 and python3 plugins into the same uwsgi emperor
      • gianluca_r joined the channel
      • t0n1c
        ok cool got it
      • jarshwah
        if that's the case (using apt) then emperor would be fine
      • t0n1c
        thanks
      • fleetfox
        t0n1c: do you come from rails?
      • t0n1c
        fleetfox: hehe kind of, first time I learned MVC pattern was using rails
      • gianluca_r
        hello, is this doc still valid: https://docs.djangoproject.com/en/1.9/topics/db... ? I keep getting "'NoneType' object is not callable" exception
      • edigiacomo
        iceboxx: if the standard library isn't powerful enough, maybe fabric or invoke?
      • edigiacomo has left the channel
      • jarshwah
        gianluca_r: show what you're overriding
      • fleetfox
      • ksuresh has left the channel
      • gianluca_r
        jarshwah: with a paste?
      • jarshwah
        dpaste
      • t0n1c
        fleetfox: ty :)
      • jarshwah
      • iceboxx
        edigiacomo: my situation is such that i need to run os level commands on the client side
      • jtiai
        iceboxx: On a client?
      • iceboxx
        jtiai: yep, i was thinking of a portable http server running on the client machine., listening on a port which the web-app can talk to
      • jtiai
        iceboxx: So, what that has to do with Django?
      • gianluca_r
      • jarshwah
        and the traceback error please
      • sorry should have asked for that first
      • gianluca_r
        np, just a sec
      • pyface has quit
      • jarshwah: https://dpaste.de/1EuZ the TB
      • zz_sebcorbin is now known as sebcorbin
      • lacrymology has quit
      • iceboxx
        jtiai: i am planning to implement it in django
      • VaticanCameos
        Is it possible to raise a HTTP 400, similar to a form validation error, from a model clean()? We have a constraint that we wish to enforce on the model level, but any errors raised in model clean() will lead to Django raising HTTP 500 in response. The constraint needs to be on model level.
      • lumidify joined the channel
      • kezabelle
        not unless you implement it yourself, or find a package whose middleware handles that, AFAIK
      • jtiai
        iceboxx: Surely you can do that.
      • Leeds has quit
      • fleetfox
        maybe fabric
      • jarshwah
        gianluca_r: only obvious thing I can see is you're missing *args, **kwargs from the save() defintion and call site
      • iceboxx
        jtiai: i was hoping there is a name for what i am trying to do.. :) other dev's who have attempted to build a bridge across
      • the_rat
        VaticanCameos: you are supposed to raise ValidationError
      • jtiai
        iceboxx: Well your problem is how to launch something that can receive events from remote site on "client" machine.
      • iceboxx: Once you resolve that problem, rest is really easy to do.
      • iceboxx
        jtiai: exactly!!
      • VaticanCameos
        the_rat: So if my custom exception is a subclass of ValidationError, that should do?
      • gianluca_r
        jarshwah: it doesn't change, i have overridden that method before without specifiyng "*args, **kwargs"; if they're not in the `def save(...` method definition are not needed to be passed, so that's not the point imHo
      • the_rat
        VaticanCameos: never had to do that, but I would guess so...