#django

/

      • odigem joined the channel
      • shp11 has quit
      • cottons joined the channel
      • Zeedox_ joined the channel
      • bibhas has quit
      • Tadgh joined the channel
      • cottons has quit
      • argoneus
        CapnKernel: you there?
      • cottons joined the channel
      • amizya has quit
      • cottons has quit
      • bluedreams joined the channel
      • dray3 has quit
      • Tadgh has quit
      • nanonyme
        trewq, eval can only evaluate expressions and assignment is a statement
      • trewq, just stop wanting to do that
      • uczekalla has quit
      • dray3 joined the channel
      • bluedreams has quit
      • geardev joined the channel
      • geardev
        I previously typed `sudo -u postgres createuser admin` into a prompt
      • uczekalla joined the channel
      • and the password for the user is: password
      • within the django project, i type `python manage.py syncdb` and the error received is this: django.db.utils.OperationalError: FATAL: role "vagrant" does not exist
      • do I need to create a role for the admin user?
      • dray3 has quit
      • odigem has quit
      • jaycedars has quit
      • ewilazarus joined the channel
      • ewilazarus
        morning guys... a quick question: how do i differ STATIC_ROOT from STATICFILES_DIRS? I don't quite get the difference between them
      • bikeshedder has quit
      • b10n1k joined the channel
      • misterpink has quit
      • geardev
        okay, so within the tutorial/settings.py, I put 'USER': 'admin', 'PASSWORD' and it is now complaining that it can't auth for the user
      • codeitloadit joined the channel
      • cottons joined the channel
      • EyePulp joined the channel
      • josuebrunel has quit
      • lieber joined the channel
      • jiraffe has quit
      • eVRiAL joined the channel
      • EyePulp has quit
      • garrypolley joined the channel
      • mekhami has quit
      • garrypolley has quit
      • tbxyz has quit
      • melinath joined the channel
      • Muchoz joined the channel
      • mstrcnvs
        ewilazarus: STATIC_ROOT is where your static files will be collected to, STATICFILES_DIRS, is where your static files will be collected *from*
      • zkanda has quit
      • other than app static dirs, which are automatically discovered
      • uczekalla has quit
      • uczekalla joined the channel
      • geardev has quit
      • adam_293
        so i have this simple view https://dpaste.de/NNYo how can i validate users click like only one time.. guess a good way would be via ip address
      • mstrcnvs
        is the user logged in?
      • if so, you could create a PropertyLike model, that would record the user who liked
      • serraphyn has quit
      • then before creating another like, you would check if the user already liked it
      • or likes could be an M2M to User
      • so it would be properties.likes.add(request.user)
      • and properties.likes.count() to get the amount of likes
      • codeitloadit has quit
      • dseitz joined the channel
      • adam_293
        mstrcnvs: yes but the idea was to let even anonymous users to hit like
      • mstrcnvs
        you would need to record somewhere, even if its only the IP address
      • DebianTUX joined the channel
      • bluedreams joined the channel
      • FunkyBob
        but going by IP address will kill people with NATd connections
      • like most workplaces, homes, etc
      • DebianTUX
        hi all. i'm using django and angular js for a refreshless website (not using djangular, not the best aproach for my project).
      • the first task would be login the user. but after login(user) (the login request comes as ajax) i dont't have a user loged in , no session started
      • is there anything i need to pass in the request (read sessionid from the cookies, for example)?
      • adam_293
        FunkyBob: what would be a good approach for this?
      • FunkyBob
        depends on how strict you want to be
      • DebianTUX: I think you'll find the common term is "Single Page App", not refreshless
      • DebianTUX
        the website is completely mvvm, a static folder containing the angular application and json request/response
      • FunkyBob: yes, sorry, not finding the english words, a bit tired here
      • FunkyBob
        DebianTUX: so the response from the login is workin?
      • DebianTUX
        yes
      • FunkyBob
        that's ok... I think 'refreshless' is a good word :)
      • mijicd joined the channel
      • bluedreams has quit
      • DebianTUX
        yeah. it's refreshless, there are only local routes in angular application
      • sudobangbang has quit
      • FunkyBob
        I did a SPA recently using knockout/sammy
      • adam_293
        well i just dont want to have a user hitting 23423424 likes
      • FunkyBob
        adam_293: I mean, you could drop a cookie... but people could clear it
      • you oculd set a value in their session, but they could clear the session cookie
      • DebianTUX
        FunkyBob: did you pass the django cookies in the javascript request? it's my first time in mvvm
      • scarabx has quit
      • FunkyBob
        DebianTUX: are you sure you're retaining and passing the CSRF token? is the session token persisting?
      • DebianTUX
        FunkyBob: i've disabled the csrf for this view. not expecting to use it for now. the session token is not persisting
      • eVRiAL has quit
      • FunkyBob: i wouldn't like to do the django first request bootstrap, i mean, it should come from the static content in the first place. don't know if this is the best approach actualy, but we are using a proprietary angularjs template, project requirement
      • hell_razer joined the channel
      • FunkyBob: it would be very traumatic to integrate this template with django. lots of grunt and bower dependencies
      • FunkyBob
        no, you shouldn't be getting django cookies from static content
      • DebianTUX: heh... I wonder if my django-amn would help :)
      • DebianTUX
        FunkyBob: well, if you could send me, that counldn't hurt :P
      • FunkyBob: ensure_csrf_cookie could help me, do you think?
      • i could set $http.defaults.headers.post['X-CSRFToken'] = $cookies.csrftoken;
      • uczekalla has quit
      • chachan joined the channel
      • Muchoz has quit
      • futureda_ is now known as futuredale[UF]
      • chachan has quit
      • FunkyBob
        DebianTUX: yes, I used ensure_csrf_cookie on my index page
      • NomadJim joined the channel
      • DebianTUX
        FunkyBob: testing it right now
      • end0 joined the channel
      • mijicd has quit
      • b10n1k has quit
      • FunkyBob: my doubt is: i didn't set a cookie for the first time i requested login page. so, there is no csrf to be sent, right? don't think that would work
      • Browser has quit
      • mijicd joined the channel
      • gremmie has quit
      • kenpachi joined the channel
      • cottons has quit
      • FunkyBob: damn, my grunt server takes SO LONG to run...
      • uczekalla joined the channel
      • eVRiAL joined the channel
      • EyePulp joined the channel
      • nihilist_ has quit
      • mijicd has quit
      • EyePulp has quit
      • garrypolley joined the channel
      • codeitloadit joined the channel
      • argoneus
        guys
      • do you have separate projects for production / dev?
      • FunkyBob
        DebianTUX: are any of your pages being served by django?
      • argoneus
        or rather, should I do that?
      • FunkyBob
        argoneus: no, but I have separate settings files
      • argoneus
        FunkyBob: what if you are updating layout?
      • doesn't it get messy?
      • I just don't really understand how I'm supposed to do it
      • end0 has quit
      • since on dev I'd rather use runserver and on production I'd rather use apache
      • + maybe I am changing templates etc
      • codeitloadit has quit
      • I just don't understand how to do it as one project
      • DebianTUX
        FunkyBob: no, no pages served by django, only json post responses
      • garrypolley has quit
      • FunkyBob
        argoneus: you're not developing on your production server, are you?
      • argoneus
        well, no, but I'd like it to be as easy as just hg pull
      • FunkyBob
        yeah...
      • I'm confused
      • pyface joined the channel
      • why would this require two projects?
      • instead of just two checkouts of the repo