#django

/

      • wradik joined the channel
      • altipard joined the channel
      • cyberdelia joined the channel
      • tWoolie joined the channel
      • margle joined the channel
      • FunkyBob
        zatan: ?
      • Nirvo: let's see if I remember from my hostgator setups...
      • Nirvo: did you chmod +x your .wsgi script?
      • Nirvo
        yes
      • 755
      • OmidRaha joined the channel
      • FunkyBob
        are you using a virtualenv?
      • OmidRaha
        Hi, how to set default `True` value for `forms.BooleanField` ?
      • Nirvo
        no I dont.
      • Sandern joined the channel
      • joshfinnie joined the channel
      • FunkyBob
        Nirvo: ok... you have SSH acccess, yes?
      • Nirvo
        yes
      • FunkyBob
        run the index.wsgi script from the shell
      • OmidRaha
        `forms.BooleanField` not have `default` option
      • FunkyBob
        OmidRaha: it has an initial option
      • OmidRaha: or you can pass intial to the form
      • OmidRaha: or set it in a custom __init__ method
      • vakaras joined the channel
      • OmidRaha
        FunkyBob: I want use it as a fallback
      • Nirvo
        Funkybob: I see some HTML output. But there might be some errors at the begining since I cant see the whole output
      • EnTeQuAk joined the channel
      • YoMomma joined the channel
      • FunkyBob
        Nirvo: pipe it through more, then
      • did you write a 404.html ?
      • Nirvo
        no
      • RuslanPopov joined the channel
      • FunkyBob
        you're probably going to want to :)
      • is this the first time you've tried to deploy?
      • Nirvo
        yes
      • it is
      • FunkyBob
        are you uding Django 1.4 ?
      • using
      • Ronnie joined the channel
      • their instructions are slightly wrong for 1.4
      • [and, interestingly, slightly wrong for <1.4 :), but in a different way]
      • Nirvo: hello?
      • Nirvo
        yes
      • 1.4
      • FunkyBob
        ok
      • Nirvo
        well it says in top lines of output WSGIServer: missing FastCGI parm REQUEST method required
      • FunkyBob
        then change the sys.path.insert to insert the project dir
      • the one with manage.py in it
      • Nirvo
        ok will try
      • nope still nothing
      • I get premature end of script headers .fcgi file in error log now.
      • FunkyBob
        and you did a pip install django flup ?
      • hmm
      • Nirvo
        yes flup is installed
      • FunkyBob
        but it's not working?
      • jaddison joined the channel
      • Nirvo
        how can I check?
      • leo2007 joined the channel
      • bradleyayers joined the channel
      • FunkyBob
        hit the site
      • bradleyayers
        FunkyBob: i would like some advice
      • FunkyBob
        how much is it worth to ya?
      • robmorrissey joined the channel
      • cyberdelia joined the channel
      • I'll be back after dinner...
      • bradleyayers
        well, i don't know how much
      • i suppose it's worth my time asking you
      • Nirvo
        FunkyBob: Thanks for the help man!!!!! It works now :)
      • FunkyBob
        back
      • Nirvo: cool
      • bradleyayers: ?
      • still waiting for you to ask
      • jita joined the channel
      • iwtu joined the channel
      • iwtu
        hi. model abstract class. What is difference between attributes in class which has meta subclass and attributes which are in that meta sublas?
      • thelodger joined the channel
      • bradleyayers
        so i've never done any performance tuning, other than using django-debug-toolbar to see how many queries are done, and to try and reduce it
      • FunkyBob
        ah
      • iwtu
        https://docs.djangoproject.com/en/dev/topics/db... what does ordering['name'] does in meta class?
      • bradleyayers
        and it's not really an issue since the stuff i do is low traffic internal business tools
      • but, what's the low hanging fruit that i would be worth me looking into
      • you seem to have an interest in such things
      • with your talk of template performance tests etc
      • FunkyBob
        ok
      • well, yo uknow select_related and prefetch_related
      • bradleyayers
        right, so other than reducing queries
      • FunkyBob
        in templates... avoid hitting the same query repeatedly... avoid excess inheritance... and {% include %}
      • bradleyayers
        how bad is include?
      • i was going to ask what the overhead of rendering a template is, e.g. Template('').render(Context())
      • but i realise i can just time it
      • FunkyBob
        :)
      • oh, also... use the caching template loader
      • OmidRaha has left the channel
      • iwtu
        does anyone know? :)
      • FunkyBob
        but really.. point NewRelic at it... it will show you soon enough
      • bradleyayers
        iwtu: show us code
      • FunkyBob
        iwtu: where is ordering['name'] ?
      • bradleyayers
        iwtu: your question is ambugious to me
      • ambiguous even
      • FunkyBob
        normally it's a list
      • gbel joined the channel
      • bradleyayers
        FunkyBob: what about OS tuning
      • F1skr joined the channel
      • or database stuff?
      • do you do anything more than create index
      • FunkyBob
        yes
      • out-of-the-box, Postgres is usually poorly configured
      • especially for write-heavy loads
      • iwtu
        what is difference between attribues in abstract class and attribues in meta class within the abstract class
      • FunkyBob
        iwtu: one's on the class, one's in the meta class
      • bradleyayers
        iwtu: show us code
      • just show us code with both cases
      • FunkyBob
        iwtu: or tell us the problem you're really trying to solve
      • iwtu
        I showed you. I don't have any own code because I don't know when the attibutes should be on class and when on meta class
      • attribues on meta class has confused me
      • or the meta class is some special class with predefined attribues I can use?
      • bradleyayers
        FunkyBob: so do you just google around for postgres tuning guides
      • FunkyBob
        bradleyayers: there's a tuning tool... but just reading the pg docs is a good start
      • iwtu: exactly like with normal models... anything that goes on a Meta class ... goes on the meta class
      • iwtu
        oh. I see. All clear now :)
      • one more question. I am familiar with MVC but I missed Controller in Django. So.. the logic should be implement in view or model?
      • FunkyBob
        don
      • 't
      • just ... don't
      • stop trying to force MVC concepts onto Django
      • there's a strong argument that _no_ web framework is, in fact, MVC...
      • bradleyayers
        i put business functions in reusable functions
      • app functions
      • then call them when necessary from views
      • FunkyBob
        iwtu: request comes in, is routed to a view function by the url patterns... view function returns a response.
      • done
      • iwtu
        reusable function in model and the other in view?
      • bradleyayers
        if it makes sense to wrap up some functionality as a method on the model, do that
      • iwtu
        the other are single use purpose
      • bradleyayers
        if it's more general purpose, i make a separate module and put it in that
      • for example creating emails to send
      • i have an emails.py, with functions to create different types of emails
      • FunkyBob
        remember that models don't have implicit access to the request...
      • bradleyayers
        the functions take information they require for the email, perhaps a model instance, and return a Django email object
      • iwtu
        ok. great guys :) I think I undestand somehow :)
      • bradleyayers
        in a view, if an email should be sent, i create one and send it
      • archdori joined the channel
      • if you put everything in views, it becomes difficult to test
      • unit test, that is
      • iwtu: thank you for the question
      • FunkyBob
        bradleyayers: I'm serious about New Relic, btw... no way i'd do without now... even on the free account
      • bradleyayers
        i have new relic setup
      • gbel joined the channel