#django

/

      • GrahamDumpleton
        Look at your service log file for anything.
      • jfw joined the channel
      • umc
        FunkyBob: http://dpaste.org/zFyBR/#L30 this is the code + traceback. there's no logic yet in the views, I just wanted to check that urls work properly (and they don't)
      • and if I manually try the /order-subscription/1/ url for example, it works fine, because that object exists
      • Bosox20051 has quit
      • sprezzatura
        GrahamDumpleton: uwsgi service logs?
      • FunkyBob
        umc: as I said, and you seem to be ignoring, I don't think the issue is with that url pattern
      • GrahamDumpleton
        Whereever stderr/stdout of that init script goes to.
      • umc
        ok, but that's what I'm asking, what does this error mean ? it's really not clear to me
      • FunkyBob
        umc: where's your root url patterns?
      • umc: it means one of the url pattern sets you've told it to include is empty
      • it looks like, possibly, you've told it one's called 1
      • lightstrike has quit
      • sprezzatura
        GrahamDumpleton: can i specify a log file from the nr-admin command just to check if its takig it or now at all
      • umc
        that 1 was the id of the subscription that I wanted to pass as param to reverse
      • isn't that the way to reverse urls when they are with params ?
      • GrahamDumpleton
        sprezzatura: paste bin what you init script looks like now.
      • FunkyBob
        umc: on a side note, learn to use django.shortcuts.render ...
      • and no, that's not how you pass arguments...
      • umc
        ok, than that's my mistake
      • GrahamDumpleton
        I have to go rescue wife. Or rescue kids, not sure which.
      • FunkyBob
        you should probabvly use reverse('...', kwargs={'subscription_id': obj.pk})
      • introom joined the channel
      • hvdklauw joined the channel
      • umc
        thanks FunkyBob, that was the problem
      • dblado has quit
      • most of the urls I had were without params (for now) or I didn't need to reverse them
      • and it seems that's what I did wrong
      • in templates I did use it, but it's a different syntax
      • FunkyBob
        umc: personally, if I name the argument [?P<...>] then I use kwargs
      • umc
        I'll use the same
      • FunkyBob
        yes... you could use django.shortcuts.redirect to get a similar syntax...
      • jfw has quit
      • umc
        I'll look up the docs
      • FunkyBob
        and avoid HttpResponseRedirect+reverse
      • sprezzatura
        GrahamDumpleton: http://dpaste.org/XkXG9/
      • FunkyBob
        umc: whilst you're there, read up on render :)
      • umc
        is there a good reason to avoid redirect + reverse ?
      • GrahamDumpleton
        sprezzatura: Where is newrelic-admin installed?
      • umc
        I always prefer to redirect after a post, so the user wouldn't get that resend message if he refreshes
      • sprezzatura
        GrahamDumpleton: /usr/local/bin/newrelic-admin
      • FunkyBob
        umc: I'm not saying to not redirect... I'm saying there's a shortcut
      • umc: you can use django.shortcuts.redirect to get the same thing as HttpResponseRedirect(reverse()) but with a simpler syntax
      • umc
        ah, alright. I'm reading now about both render and redirect
      • sprezzatura
        GrahamDumpleton: this shouldnt be so hard :-/
      • FunkyBob
        sprezzatura: it wasn't for me... but I'm not using it with uwsgi
      • sprezzatura
        FunkyBob: gunicorn?
      • FunkyBob
        yep
      • sprezzatura
        well, i wanted to measure with uwsgi and then with gunicorn.
      • GrahamDumpleton
        If done right it isn't. Haven't worked out what you are doing wrong yet. :)
      • FunkyBob
        very busy site, is it?
      • sprezzatura
        how much memory does gunicorn consume..can you tell me from nr site? FunkyBob
      • GrahamDumpleton
        Just before that exec line add:
      • sprezzatura
        GrahamDumpleton: am listening :)
      • FunkyBob
        sprezzatura: we appear to have a memory leak
      • GrahamDumpleton
        newrelic-admin local-config $NEW_RELIC_CONFIG_FILE > /tmp/newrelic-config.log
      • When you restart, does that file appear and have content.
      • sprezzatura
        GrahamDumpleton: that is before the exec?
      • GrahamDumpleton
        On a line by itself.
      • No exec on that line.
      • sprezzatura
        ok.
      • FunkyBob: but how much does the gunicorn process take? nr should tell you that right
      • FunkyBob
        sprezzatura: "it depends"
      • sprezzatura
        GrahamDumpleton: nope. doesnt get created. shouldnt there be an exec?
      • GrahamDumpleton
        No 'exec'.
      • sprezzatura
        ok. i have no 'exec' and tried. file not created
      • AntiSpamMeta_ joined the channel
      • AntiSpamMeta_ is now known as AntiSpamMeta
      • twoolie has quit
      • GrahamDumpleton
        You put 'exec' and nothing else in that script after that point will be run.
      • sprezzatura
        noted. didnt put
      • GrahamDumpleton
        If that file isn't being created, that script file isn't even being run at all.
      • What command are you using to restart the service.
      • sprezzatura
        uwsgi restart should pick that up right?
      • GrahamDumpleton: 'sudo /etc/init.d/uwsgi restart'
      • GrahamDumpleton
        Depends on the script setup. A restart may just be sending a signal to existing process.
      • May need a start and then a stop.
      • Whoops. Stop and then start.
      • sprezzatura
        trying.
      • nope. nada. zilch.
      • umc
        FunkyBob: nice shortcuts, code looks nicer now :). I ended up using: return redirect('account:url_order_subscription', subscription_id=subscription.id). looks nicer
      • FunkyBob
        umc: yep
      • umc
        thanks
      • glad I've learned new things today, and it's only 9:36 AM here :)
      • pzuraq has quit
      • ngotho joined the channel
      • frequant joined the channel
      • sayan has quit
      • bosim joined the channel
      • zandauxzan has quit
      • jfw joined the channel
      • FunkyBob
        If you've done 6 impossible things this morning, why not round if off with a visit to Milliways, the restaurant at the end of the univers?
      • JesseH sips on his tea.
      • madprops
        lol
      • sudesh has quit
      • areil joined the channel
      • codeme joined the channel
      • aberrant has quit
      • dblado joined the channel
      • schliep has quit
      • techdragon has quit
      • wilywonka has quit
      • geaden joined the channel
      • twoolie joined the channel
      • __love__ has quit
      • naro has quit
      • codeme has quit
      • ls3 has quit
      • timini joined the channel
      • jorvis
        FunkyBob: It's working now. I did a full new install from source of py3.3, django-dev, and all dependencies
      • stephenmcd has quit
      • FunkyBob
        scary
      • johnraz joined the channel
      • jorvis: which DBMS you using?
      • jorvis
        for now, just sqlite3
      • ngotho has quit
      • timini
        I'm getting an error on a form, but it doesn't seem to be coming from the field's validation checks. Is there any other places a "This is not a valid email" erro could be generated?
      • FunkyBob
        I've not really looked at which of the modules we're using are py3 compatible
      • timini: well, there's the non-field errors
      • codeme joined the channel
      • the_rat joined the channel
      • jayant__
        i am trying to have multiple settings file, in a settings folder.. so i changed manage.py to one of the settings, "{{project_name}}.settings.local" but that didnt seem to work
      • FunkyBob
        jayant__: why not do it the documented way? using --settings or DJANGO_SETTINGS_MODULE ?
      • also, did you create a __init__.py in your settings/ dir?
      • timini
        FunkyBob: This sounds like a field error because it's referring to email validation, Does a form run the model's validators?
      • jayant__
        FunkyBob: well isnt the DJANGO_SETTINGS_MODULE beeing set in manage.py ??
      • FunkyBob
        timini: I believe the docs will confirm a ModelForm will
      • jayant__: only as a default
      • jayant__
        FunkyBob: how are those two different?
      • FunkyBob
        jayant__: what about my other question?
      • arturrro has quit
      • jayant__
        why not use --settings , because this seems to be best way to add default settings file
      • which i need to follow
      • scruz has quit
      • i mena which i need to use
      • dblado has quit
      • jfw has quit
      • FunkyBob: i need 1 settings as default, and others for production, dev and such
      • FunkyBob
        jayant__: for that case, we use DJAGNO_SETTINGS_MODULE
      • but you haven't answered my other question
      • (07:04) < FunkyBob> also, did you create a __init__.py in your settings/ dir?
      • jayant__
        ohh no,
      • timini
        FunkyBob: Am I using these CBVs correctly? http://dpaste.com/1085611/
      • jayant__
        FunkyBob: yeah, i forgot __init__.py
      • madprops has quit
      • dumb dumb
      • FunkyBob
        timini: probably not
      • timini: I use them so rarely, I'm not certain... but generally looks ok
      • timini: don't use count() to test for existence... use exists()
      • tophalf01 has quit