#django

/

      • ybathia has quit
      • djdduty has quit
      • ybathia joined the channel
      • ybathia has quit
      • delizin
        Ruzzy: I don't know anything specifically for angular or single page designs, but I imagine most people here use the django.contrib.auth package for logins
      • SteenJobs joined the channel
      • stickperson has quit
      • sheldo joined the channel
      • anomalousfailure is now known as anomalousresigna
      • anomalousresigna is now known as anomresignation
      • pydave6367 joined the channel
      • SecondForm_Glenn has quit
      • sheldo has quit
      • Lisa1157 joined the channel
      • sheldo joined the channel
      • Ruzzy
        Well I'm looking at the django rest framework docs on this
      • jsfan2 has quit
      • Knyght
        If you want to do it through an API there are apps for that
      • Lisa1157_ joined the channel
      • Ruzzy
        the docs actually say "Warning: Always use Django's standard login view when creating login pages. This will ensure your login views are properly protected."
      • I don't know if it means use the actual login page that takes the info as post data like on the django admin, of if there's a rest endpoint that takes a json login and returns a token or something
      • what do they mean by this?
      • Lisa1157 has quit
      • Bryson has quit
      • Lisa1157_ has left the channel
      • Lisa1157_ joined the channel
      • mkoistinen has quit
      • waveclaw has quit
      • agentorange
        in django rest framework can I call a method or property on a model as a serializer field
      • surfnturf has quit
      • Phrohdoh joined the channel
      • jessamynsmith joined the channel
      • Phrohdoh
        Hi, how can I trigger the bot so I can see how it works alongside reading the code?
      • ticketbot:
      • !help
      • a00cf3d
      • slick666_work has quit
      • c9mm9dore has quit
      • jessamyn_ joined the channel
      • jarshwah joined the channel
      • c9mm9dore joined the channel
      • jessamynsmith has quit
      • kingplusplus_ joined the channel
      • c9mm9dore has quit
      • ruind has quit
      • kingplusplus has quit
      • kingplusplus_ is now known as kingplusplus
      • pcg joined the channel
      • lordkryss has quit
      • denys has quit
      • abara joined the channel
      • Fuyou has quit
      • cnk
        Ruzzy: Django uses the word 'view' to be the code with the logic in it the page aka html
      • agentorange: yes you can serialize model fields taht are not just the columns.
      • I have been using model properties but I think you can also use regular methods
      • agentorange
        yeah i found Field(source='method') and SerializerMethodField('method')
      • thanks
      • cnk
        good
      • Lisa1157_
        getting an error here with a multiline comment https://dpaste.de/tdKr#L
      • schneider joined the channel
      • ubernostrum
        Lisa1157_: what error are you getting?
      • metastableB_ is now known as metastableb
      • Phrohdoh
        How does MyModelType.objects.all() work? I never created an `objects` property, is it inherited? and does the `save` method write to it?
      • cnk
        that is a call into the model manager. A default manager is created when you create a model in django
      • Phrohdoh
        filtering looks like an attrib hack
      • Question.objects.filter(question_text__startswith='What'), prototype-ish
      • delizin
        Phrohdoh: Here is some info on managers https://docs.djangoproject.com/en/1.8/topics/db...
      • Phrohdoh
        So when I save() my model instances are comitted to the db, and `objects` pulls that from the manager?
      • delizin
        objects is the manager.
      • Phrohdoh
        oh right, that makes sense I see
      • Hmm, I don't think I like the attribute creation so far. `choice_set` was created on my model at some point and I don't know how/when or when objects are added.
      • cnk
        Phrohdoh: do you have a foreign key field?
      • Phrohdoh
        yes
      • cnk
        relatedmodel_set is django for the set of related things
      • Phrohdoh: sounds like you are transitioning from a different ORM, yes? if so, which?
      • Phrohdoh
        None, I just started web-dev today.
      • alyphen has quit
      • metastableb is now known as metastableB_
      • kadfak has quit
      • buckley has quit
      • alyphen joined the channel
      • djapo
        are there any books that are specifically focused on web app deployment?
      • TurBoss has left the channel
      • delizin
        djapo: Well Two Scoops of Django has a lot of helpful tips
      • cnk
        djapo: one for rails, but I am guessing you want python
      • Phrohdoh is now known as Phroh|away
      • Phroh|away has quit
      • abara has quit
      • djapo
        specifically looking for python, i guess i could buy the book for just that chapter :/
      • cnk
        The DigitalOcean docs are pretty good for deployments of various kinds
      • GJdan has quit
      • nirakara
        there's a popular django/nginx/gunicorn/postgresql post that works
      • cnk
        to be honest, I am disappointed with 2 scoops - pretty espensive and good but not that good
      • nirakara
        and then once you understand the toolchain u can adapt to need
      • SteenJobs has quit
      • jessamyn_
        djapo: I mostly used the heroku docs
      • shangxiao joined the channel
      • delizin
        djapo: http://www.fullstackpython.com/django.html has a list with a some books, articles and tutorials for django
      • cnk
        djapo: Is hosting on Heroku an option for a while? It is so much faster to get things out in the wild. might be worth some $ instead of spending time
      • delizin
        cnk: I picked up Two Scoops second hand, but agree that it isn't worth the price new
      • ojii|work joined the channel
      • Lisa1157_
        sorry i afked for a min, ubernostrum im getting "IndentationError: unexpected indent"
      • delizin
      • Lisa1157_
        ubernostrum it says error is at the start of line 8
      • djapo
        looks like those are the best resource comes from the hosting providers, the problem with the books is that i only need information on this one topic and the information on the table of contents leads me to believe that they only skim the surface
      • jessamyn_
        djapo: yeah, I mostly have used blog posts
      • cnk
        delizin: Thanks. I'll have a look at that. See if it shows a better way to do chef. Our own cookbooks have been so brrittle we are dropping chef
      • djapo
        uh neat, ill have to clone that locally
      • lorddaedra joined the channel
      • viwal has quit
      • delizin
        Hopefully it helps, I haven't used it. When I did my first deployments I used the tutorials from linode and digital ocean
      • Lisa1157_
        getting an error here with a multiline comment https://dpaste.de/tdKr#L
      • it says error is at the start of line 8
      • getting "IndentationError: unexpected indent"
      • delizin
        Lisa1157_: And that is an exact copy and paste? I'm not seeing anything wrong just looking at it
      • Lisa1157_
        yes that is an exact copy
      • cnk has quit
      • cssko has quit
      • nouveaux joined the channel
      • delizin
        Can you paste the full traceback?
      • Lisa1157_
        delizin: i re did the indentations for the file using my editor, for some reason this fixed it
      • nouveaux
        Hi there. I'm currently have an app that I'm using and I want to customize it for my project. What are the best practices for this? Specifically, I want to modify the models file.
      • eka has quit
      • delizin
        nouveaux: Well how do you want to customize the models? Replace them or extend them?
      • Lisa1157_: Glad to hear it. Might have just been something funny with tabs vs spaces
      • nouveaux
        delizin: replace it.
      • delizin: actually I just want to add a couple of fields, so probably extend it.
      • tiagoboldt joined the channel
      • delizin
        nouveaux: Extending it would probably be easier than replacing it. Would it work in your case to create a new model that links to the app model with a one-to-one foreign key?
      • Lisa1157_
        could i get a brief explanation as to what 'pass' means/is used for in admin.py file?
      • nouveaux
        the Flag model
      • Lisa1157_
        tutorial i am following didnt really cover it
      • slick666_work joined the channel
      • tiagoboldt has quit
      • nouveaux
        Lisa1157_: pass usually means don't do anything
      • delizin
        Lisa1157_: It is skipping the class definition. It is just a placeholder pretty much since you can't just define a class or function and leave it empty
      • tiagoboldt joined the channel
      • Lisa1157_: With that code you would remove the comments from the above lines and then could remove pass so it would execute the commented out code
      • Lisa1157_
        okay thanks delizin and nouveaux
      • slick666_work has quit
      • eka joined the channel
      • jladage has quit
      • linkedinyou joined the channel
      • dlam has quit
      • lorddaedra has quit
      • nirakara joined the channel
      • Hairy has quit
      • acangiani joined the channel
      • eka has quit