#django

/

      • NomadJim joined the channel
      • Hairy joined the channel
      • mekhami
        KaffeeJunky123: been reading that, not yet clear to see that its calling something beyond what i explicitly call int he test
      • Guddu has quit
      • phenicie
        KaffeeJunky123: I like that :) I new i was missing something. I was just looking for something cleaner and that will work, Thanks
      • sudomarize
        i'm getting "'stylesheets/style.min.css' could not be found in the COMPRESS_ROOT '/home/user/djangoapp/static' or with staticfiles." when trying to access my application
      • roger_rabbit joined the channel
      • using nginx/gunicorn daemons. However runserver seems to work completely fine
      • rams3377 joined the channel
      • the change i made was altering my STATIC_ROOT & MEDIA_ROOT config settings to absolute paths
      • KaffeeJunky123
        mekhami: it's just patched within the testcase you patch from
      • sudomarize
        also fiddled around with my /static/ dir
      • is this a cache issue?
      • michalmo joined the channel
      • BabySuperman has quit
      • fnstudio has quit
      • mekhami
        KaffeeJunky123: i know, i just.. i make a mock service = mock.Mock(spec=Service), then service.save(), and then I want to assert that service.save() calls service.deploy()
      • nimomo joined the channel
      • so i was thinking the service mock spec would know that deploy should get called
      • rams3377 has quit
      • ojdo has quit
      • basically i need to run my tests without hittin the AWS api
      • KaffeeJunky123
        mekhami: no, you'll have to mock the deploy method
      • mekhami
        when that API call is in the service.save() method
      • abara has quit
      • ah
      • KaffeeJunky123
        oh
      • rams3377 joined the channel
      • mekhami: so, what method hits the AWS api?
      • mekhami
        pardon KaffeeJunky123 that API call is in the deploy method which gets called by the save method
      • KaffeeJunky123
        yeah
      • so you simply mock the deploy function
      • mekhami
        okay
      • KaffeeJunky123
        You can make it return the success code
      • or the error code
      • to check wether your save function handles it right
      • mekhami
        i feel like this gets unwieldy now since i have to go in to each of these tests and patch the deploy function on every test
      • cestlavie joined the channel
      • citizen-stig joined the channel
      • rain0r joined the channel
      • Tomatosoup1 joined the channel
      • KaffeeJunky123
        mekhami: well, that's the way of doing things in tests, you'll probably want to assert different things along the way
      • nimomo has quit
      • so it makes sense to patch for every testcase
      • mekhami
        KaffeeJunky123: maybe this deploy function shouldn't go in save, heh.
      • KaffeeJunky123
        mekhami: you can patch the method for a unittests class scope
      • pytony joined the channel
      • ojdo joined the channel
      • citizen-stig has quit
      • _macro joined the channel
      • kalem joined the channel
      • mekhami
        KaffeeJunky123: hmm that makes more sense
      • KaffeeJunky123
        django.test is awesome
      • I recommend searching the django and python docs when you run into trouble, it's often faster than asking on irc
      • Tomatosoup1
        hi guys, i got a question. I want to make a webapp which will be a TO-DO list. Do you think i need more classes than one: Task ?
      • mekhami
        KaffeeJunky123: i did, but sometimes the answer still eludes me
      • KaffeeJunky123
        mekhami: the more time you spend on docs, the better you'll get in understanding them
      • doismellburning
        Tomatosoup1: doubt it
      • KaffeeJunky123
        that being said, reading a good book helps, I can really recommend two scoops of django
      • telex has quit
      • maxvi joined the channel
      • mekhami: it covers pretty much all the topics of developing web applications with django
      • optikalmouse has quit
      • and it points to references and nice third party libs
      • heyts has quit
      • Tomatosoup1
        KaffeeJunky123: what project are you talking about ?
      • telex joined the channel
      • KaffeeJunky123
        Tomatosoup1: I cannot parse your question with the context provided.
      • kalem has quit
      • Tomatosoup1
        KaffeJunky123: you said that smth covers all the topics of developing web app with django: maybe you were talking about some book ?
      • maxvi
        anybody installed django on centos 6.7 ? it has python 2.6 so I have problem with it. I installed Python 2.7 but it uses python 2.6 http://pastebin.com/YGGik7j4 how can I set /usr/local/bin/python as executable ?
      • KaffeeJunky123
        Tomatosoup1: I was talking about "Two scoops of Django"
      • It's a really great book for Django beginners
      • tbaxter
        or not-so-beginners
      • BabySuperman joined the channel
      • KaffeeJunky123
        tbaxter: well, programming experience is mandatory
      • Tomatosoup1
        actually, i prefer learing from docs
      • django doc is great
      • KaffeeJunky123
        You'll have to consult the docs
      • Two Scoops of Django is mostly on best practises
      • jeadre has quit
      • Which isn't covered by the django docs
      • Tomatosoup1
        i will take a look at it :)
      • KaffeeJunky123
        actually there's a lot of no nos in the django docs
      • Tomatosoup1: don't pirate it ;)
      • ubuntu_aze joined the channel
      • jeadre joined the channel
      • garrypolley joined the channel
      • Tomatosoup1
        damn 31 $ for a single book
      • frenchiie
        ,
      • two scoops of django is really good
      • tbaxter
        Tomatosoup1: it’s worth every penny.
      • decaff joined the channel
      • emper0r joined the channel
      • graingert joined the channel
      • vdeep has quit
      • emper0r
        hi
      • i got this
      • Tomatosoup1
        that must be a great book, but im not sure if i will find this in my country
      • emper0r
        how can i get a true ? if i got this object into db
      • pantsofchocolate has quit
      • doismellburning
        buy the ebook?
      • Y3K
        emper0r: you're comparing a string with model instances
      • emper0r
        ok... so?
      • i need to know if my string exist into db..
      • iter into all objects
      • Y3K
        emper0r: Ok, that's easy, something like this: IP.objects.filter(ip=<your_ip>).exists() should do it
      • emper0r
        oh missing the exist() function
      • maxvi has left the channel
      • pantsofchocolate joined the channel
      • Y3K
        No, the filter by field as well.
      • That way you don't get all the records back, instead you only check for a single one directly on the database.
      • emper0r
        thanxs
      • works
      • u r right
      • because sis impossible if i got 1millions
      • Y3K
        Glad to help, you're welcome.
      • But are you filtering by the IP you want to check? Or just calling .filter().exists()?
      • emper0r: ^
      • Tomatosoup1 has left the channel
      • frenchiie
        Tomatosoup1: i think they sell a pdf version
      • emper0r
        i need filtering to know if exist
      • Y3K
        frenchiie: only of the ol' one IIRC
      • emper0r
        beacuse i after that if not exist i added into model
      • with a simple mode.save
      • Y3K
        emper0r: Yes, I understand that.
      • emper0r: Would you mind sharing your model on dpaste? Just to ensure we're getting this right :)
      • frenchiie
        Y3K: i think you may have it backwards, but i know for sure they sell the new one as a pdf.
      • 1.8
      • Y3K
        Oh, didn't know that.
      • frenchiie
      • it_dude has quit
      • pcg has quit
      • Y3K remember when he got the Two Scoops for 1.6
      • emper0r has quit
      • nym joined the channel
      • v0r0nwe has quit
      • TeeTime joined the channel
      • pantsofchocolate has quit
      • Hairy joined the channel
      • optikalmouse joined the channel
      • fnstudio_ joined the channel
      • harmaahylje
        frenchiie: is that book worth buying?
      • tbaxter
        very much so
      • frenchiie
        i like to think of it as the official django book
      • phenicie has quit
      • i'm still new to django but it explains everything pretty well
      • harmaahylje
        does it add to the djangodocs?
      • Y3K
        frenchiie: That's the doc...