#django

/

      • badbandit
        hey, so I tried installing admin thumb image using easy_thumbnails into existing project.. I installed it yesterday into a different project on same machine with no problems
      • but with this one I am getting error saying
      • Attempted access to '/media/products/waterproof%20hard%20carrying%20case/carrying%20case.jpg' denied.
      • all other images on the site work
      • including ones uploade
      • koobs has quit
      • any idea what would cause that?
      • koobs_ joined the channel
      • foundatron has quit
      • Cromulent has quit
      • racycle joined the channel
      • eltigre joined the channel
      • foundatron joined the channel
      • lordkryss joined the channel
      • Brewster[afk] joined the channel
      • eltigre
        I want to have a websockets service (in Tornado) run besides django. My primary idea is to have runserver (or later gunicorn in production) and the tornado server behind different ports, but fronted by a load balancer....
      • Brewster[afk] is now known as Brewster
      • but not all people in my team use linux, so haproxy is more or less out (I can't make them install weird stuff like cygwin)
      • so, any ideas?
      • hm maybe write a tornado server that proxies runserver
      • acmehandle joined the channel
      • acmehandle
        Hi, I'm encountering a database error with an app I installed. How would I trouble shoot that? Would it be through logging? If so how do I enable that?
      • ovnicraft joined the channel
      • ploufplouf has quit
      • Goopyo has quit
      • ploufplouf joined the channel
      • Goopyo joined the channel
      • kenbolton has quit
      • nvandijk has quit
      • n3storm has quit
      • eltigre
        acmehandle, I don't know what debugging route to take. It would help if you posted the traceback
      • nvandijk joined the channel
      • scrapper has quit
      • n3storm joined the channel
      • acmehandle, a frequent cause is max_length=something, and while using sqlite you didn't notice because it's not enforced and then you plug in postgres and BOOM
      • Linovia has quit
      • sixstring joined the channel
      • acmehandle
        The specific error message is "1048 Column 'session' cannot be null". I've searched the internet and found that that error is possibly attributed to a save being required after an insertion. However this error seems to be coming from an app I have installed so I was hoping perhaps to try to get to the bottom of that by debugging it.
      • EyePulp joined the channel
      • But right now I am in the process of saving the traceback to dpaste, I just have to take out some internal information.
      • sixstring
        Can you help with this problem? I login to the Django admin, click around, then try to add a new record. When I click the "Save" button, I get sent to login again. What's going on?
      • eltigre
        acmehandle, it sounds that you are somehow assuming there is a session present and that's not always the case
      • sixstring, production? runserver?
      • acmehandle
        Hhmm. Well the error is being raised via a 'user registration' window so I am assuming.
      • nkryptic has quit
      • sixstring
        eltigre: it's apache2 with mod_wsgi. i'm also running grapelli.
      • i've got a temporary work-around via "manage.py shell", but it would be nice to actually use the admin UI.
      • badbandit
        anyone know why my admin site cannot access my /media/ folder on local dev?
      • the files exist, they show up on the front end of the site
      • eltigre
        sixstring, I don't know a lot about grapelli, or any good reason to use it....
      • badbandit
        and I have another site thats a clone of this one where this works
      • Im getting "permission denied
      • eltigre
        sixstring, I suggest you check if the authorization works....
      • thepreacher joined the channel
      • badbandit, did you set DEBUG=False?
      • davidbrenneman joined the channel
      • bluepnume has quit
      • sixstring
        eltigre: which authorization? authentication is happening, because it does let me in. i don't quite follow.
      • eltigre
        badbandit, also there is a setting in settings.py about mediaadmin
      • sixstring, yes but the session has to stay authorized
      • acmehandle
        Hi, ok here is the traceback: http://dpaste.com/858043/
      • badbandit
        yes debug true
      • eltigre
        sixstring, if the session backend looses track, it will say it's unauthorized
      • Ixbidie joined the channel
      • badbandit, with your browser, look at the source of the html page, and determine the urls used for the media files. Then try to find out why runserver doesn't serve the files at this location
      • mindcruzer joined the channel
      • acmehandle, you are either misusing LFS or there is a bug in lfs... I've never used it though
      • there is also #lfs
      • mindcruzer
        wow, spent 2 hours trying to figure out how to render a formset a certain way yesterday unsuccesfully, then woke up and immediately knew how to do it
      • weird
      • eltigre
        no sorry that was wrong about #lfs ;-)
      • but I think they have a channel
      • sixstring
        mindcruzer: awesome. those are good mornings
      • marshall joined the channel
      • Linovia joined the channel
      • eltigre
        mindcruzer, first you need to forget the forest to see the trees
      • marshall
        hey django
      • and forget the trees to see the leaves
      • sixstring
        eltigre: any easy way to trace that? browser headers? cookies? DjDT?
      • marshall
        and forget the leaves to see the individual plant cells
      • and forget the cells to see the nuclei
      • acmehandle
        I am chatting with them eltigre, but I am interested in knowing how would I enable logging or debugging output to a file so I can figure this out?
      • eltigre
        sixstring, yes all of this seems reasonable.... you might also try not using grapelli
      • badbandit
        eltigre: problem is that it's a user uploaded (media), the static shows this for example /static/admin/img/icon-yes.gif
      • eltigre
        acmehandle, django-sentry is very nice
      • marshall
        and forget the nuclei to see the... wait where the hell am i
      • badbandit
        static root is "/media/"
      • er
      • media_url
      • static root is the abs path to that media folder
      • sixstring knew eltigre would suggest that. ;)
      • er media root
      • acmehandle
        Do you think django-sentry would appropriate for helping me trying to figure out whats going on in the back end?
      • eltigre
        acmehandle, no
      • but it's very nice to "log" errors
      • marc_e joined the channel
      • hirokiky has quit
      • acmehandle
        Ok, that is a good start. Are there any tools for django that would suit what I'm looking for?
      • eltigre
        acmehandle, your problem is that you are somehow putting no session into something that requires a session
      • averell has quit
      • acmehandle, you need to know what went wrong... first of all... is this reproducible or does it happen only occasionally?
      • kanja joined the channel
      • acmehandle
        Yes, I am able to reproduce it.
      • eltigre
        badbandit, I actually confuse that stuff all the time myself. But I suspect that you are somehow confusing static/uploaded media serving... django-admin has some preconceptions how to construct these urls....
      • acmehandle, also on local dev?
      • acmehandle, are you sure you didn't accidentally delete a middleware that should be there?
      • acmehandle
        No, unfortunately. Only on my webhosting site.
      • I dont think so I deleted middleware.....
      • hirokiky joined the channel
      • eltigre
        no session middleware might explain no session....
      • DSi
        nkuttler thx for the hint.. i didn't knew anything about boundfields :D thx!
      • acmehandle
        I see....
      • I did have to make some changes with regards to 'session' middle ware.
      • I added, but did not delete...I believe.
      • eltigre
        there you have it then
      • acmehandle
        It looks like I added django.contrib.messages.middleware.MessageMiddleware.
      • thepreacher has quit
      • nvandijk has quit
      • eltigre
        hm that shouldn't really be a problem
      • estebistec joined the channel
      • badbandit
        eltigre: I think I funneled the problem down
      • eltigre
        what I found from your traceback is that the error happens entirely in lfs code... but that doesn't mean it's not your fault ;-)
      • badbandit
        eltigre: something with easy_thumbnails
      • eltigre
        badbandit, great ;-)
      • badbandit
        http://dpaste.com/858047/ this works for instance
      • eltigre
        nice, didn't know about that
      • acmehandle
        I dont disagree entirely. :-)
      • Hence why I wanted to get a logging facility running.
      • badbandit
        eltigre: http://dpaste.com/858050/ this does not though
      • EmoSpice has quit
      • Linovia has quit
      • hirokiky has quit
      • mindcruzer
        Can anyone see why the 'type' attribute that I'm specifying on this form field wouldn't be taking? http://dpaste.org/3ZC48/
      • just renders as type="text"
      • arturrro has quit
      • or can i not modify that?
      • Linovia joined the channel
      • chachan has quit
      • badbandit
        wtfffffff I can convert it with easy_thumbnails in shell
      • but in my code it says "source file does not appear to be a valid image
      • foundatron has quit
      • Bun joined the channel
      • eltigre
        mindcruzer, no you can't modify that this way
      • mindcruzer, the type of the input is still text
      • mindcruzer
        eltigre: yeah i fixed it by just making a NumberInput class and overriding `input_type`
      • cro joined the channel
      • eltigre
        mindcruzer, ok
      • mindcruzer
        which inherits from forms.widgets.Input *
      • rafaduran has quit
      • is there a reason you can set it through attrs?