#django

/

      • garrettdreyfus
        doismellburning: sorry lemme upload that real quick
      • josuebrunel joined the channel
      • tbaxter
        if it’s anyhing you’re going to interact with in any interesting way, it need to be loaded in installed apps. The only exception is really root-level libraries
      • konradb
        how can I make models.CharField to accept utf-8?
      • croepha has quit
      • garrettdreyfus
        doismellburning: here it is https://dpaste.de/bSO5
      • tbaxter
        there is nothing about Charfield that stops you from accepting UTF-8
      • you’re doing something wrong somewhere.
      • naro has quit
      • konradb
        'ascii' codec can't encode character u'\u0142' in position 7: ordinal not in range(128)
      • it's from django admin
      • when trying to add utf-8 char in charfield
      • yoyoohrho joined the channel
      • apollo13
        konradb: please see the topic
      • konradb: django itself fully works with unicode, so…
      • Neo-- has quit
      • doismellburning
        garrettdreyfus: 'fraid I can't be much help - never touched formwizards
      • batteronizer has quit
      • tbaxter
        I did, once…
      • konradb
        apollo13: I have long link to bitbucket, should I use bit.ly or paste raw? ;_;
      • VITIMan has quit
      • tbaxter
        dpaste
      • aylo joined the channel
      • apollo13
        konradb: links to bitbucket are fine
      • garrypolley_ has quit
      • konradb
      • apollo13
        and the traceback?
      • doza_ joined the channel
      • softinio joined the channel
      • konradb
        There is problem when trying add utf-8 char in Title of models.Entry
      • croepha joined the channel
      • give me a sec, uploading error message
      • collinanderson
        are you using python2.7? are you ever using "%s some text" % something?
      • toothfairy_ joined the channel
      • Goopyo joined the channel
      • konradb
        yes, in some places
      • and yes, 2.7
      • tbaxter
        mysql?
      • collinanderson
        konradb: is it your image field?
      • konradb
        default, so sqlite3
      • apollo13
        konradb: if you use 2.7 you shouldn't use __str__ but __unicode__ for instance
      • toothfairy_
        gmf$ . venv1.7/bin/activate gmf$ pip3 install django==1.7 Could not find an activated virtualenv (required). Any ideas?
      • konradb
        collinanderson: no, Title, charField
      • toothfairy_
        the venv seems very activated to me
      • apollo13
        toothfairy_: afaik if the venv is active it will change your bash prompt
      • ie (tmp-6fd4b016d47b057d)florian@apollo13:~/
      • tbaxter
      • lxer
        toothfairy_: source bin/activate
      • garrettdreyfus
        doismellburning: Thank you anyways!
      • konradb
        tbaxter: I'll try
      • tyfighter joined the channel
      • doza_
        try source venv1.7/bin/activate
      • yvear
        are all these fixed or must all patches be applied manually? http://django.readthedocs.org/en/latest/release...
      • tbaxter
        apollo13: konradb: if you use 2.7 you shouldn't use __str__ but __unicode__ for instance
      • toothfairy_
        apollo13: it changes: (venv1.7)gmfs-iMac:~ gmf$ pip3 install django==1.7 Doesn't "." correspond to "source"?
      • konradb
      • apollo13
        yvear: they are of course fixed if you use the latest release of every supported version
      • konradb
        but I think that __unicode__ will fix the problem
      • gnudestallman joined the channel
      • kavefish joined the channel
      • yeah it works. Thank you
      • croepha has quit
      • gnudestallman
        Hello I am learning about Django. I know little to nothing about web-development in general. My question is, for what kinds of projects would I require Django vs. pure html or javascript?
      • umadbor joined the channel
      • bananaa
        gnudestallman: as soon as you need your website to be dynamic (for example, when you store data) you need something like django
      • romgar has quit
      • andrei1 joined the channel
      • croepha joined the channel
      • ankesh11 joined the channel
      • kavefish
        apologies for asking what may be a silly question, but I'm confused on how to approach my goal. I'd like to make a variable (representing categories of articles/content) available to the site base template so my nav menu can render a drop down menu for each category.
      • presently it feels like I'd have to modify each view to augment the context passed to the template
      • gnudestallman
        bananaa: So Django has no use for a static website?
      • bananaa: What would be a common alternative to Django one might consider?
      • kavefish
        gnudestallman: django would be overkill for a static site. more overhead than necessary.
      • bananaa
        gnudestallman: there are lots of alternatives. Python: web.py, flask. Ruby: Rails, Sinatra. PHP: Laravel, Codeigniter. etc
      • tbaxter
        if a site is truly static, then just plain old HTML is all you need :-)
      • But what site is really static?
      • kavefish
        gnudestallman: what tbaxter said
      • Jyrsa
        gnudestallman, if what you actually want is a CMS then django-cms might be what you're looking for
      • tbaxter
        kavefish: I’d probably have a Category model, and include it via a context processor or template tag
      • msc joined the channel
      • although I don’t believe in building Nav server-side at all.
      • kavefish
        thanks tbaxter. I have a category model. not sure how to do that last part
      • gnudestallman
        Jyrsa: Does Django-cms work with Django or independently?
      • kavefish
        but at least those are some words I can Google
      • gnudestallman
        tbaxter: good point
      • umadbor
        Anyone know how to use sessions (i.e. set cookie sessionid) on anonymous requests? I know that sessionid is set during user auth via admin or other logic using django inbuilt auth system. I was wondering how to use the same session api for unauthenticated users.
      • Jyrsa
        gnudestallman, it's made with django
      • softinio
        guys I need a django based blog up and running quick whilst I add functionality later which of the apps do you recommend? mezanine , feincms, djangocms and zinnia are afew i have come across
      • tbaxter
        it builds upon django. I don’t think a beginner should tackle django-cms, personally. That’s a steep learning curve, and so far you’ve said nothing that makes me think you need/want a massive CMS
      • softinio: if it’s just a blog, there are a zillion choices. You can whip up one in an afternnon.
      • epicserve has left the channel
      • Jyrsa
        tbaxter, a much better question is should you whip one up in an afternoon :)
      • gnudestallman
        tbaxter: Well, I don't have any project in mind. But I am working through a textbook on TDD that uses Django, so I am thinking about potential fun projects to use now that I am learning Django
      • tbaxter
        a valid question
      • kavefish
      • gnudestallman
        Maybe a personal website. Seems like everybody has one of those
      • But would a personal website be a good fit for a Django project?
      • tbaxter
        gnudestallman: nice. I definitely wouldn’t use django-cms then. I’d just make the personal website I wanted. it’ll be a nice learning experience.
      • sure
      • the real question is, what sort of personal website do you want?
      • softinio
        @tbaxter nice ! thank you
      • malgorath
        is there a way in sinde my forms.py file I can define an array like choices = ((1, 'First'), (2, 'Second')) and use it in different classes?
      • gopar joined the channel
      • gnudestallman
        I don't know. Biography. CV. Projects I've worked on
      • Jyrsa
        gnudestallman, i use ikiwiki for mine
      • speaking of which i may not have updated it for over a year
      • gnudestallman
        Something I can link to and help me get a job in the future
      • malgorath
        er way inside my forms.py ...
      • tbaxter
        gnudestallman: I’d use flatpages for the more static bits, then maybe hook into the github api for the projects part.
      • gnudestallman
        I have a personal private mediawiki
      • Jyrsa
        gnudestallman, a personal web page helping you get a job is a bit 1990s, unless you're a graphic designer
      • tbaxter
        maybe tap into twitter or something for a some other things
      • Jyrsa: but a link to the github repo showing the code for your personal site....
      • The beauty of personal sites is that they allow you to pursue anything you’re interested in. Just find a way to do.
      • gnudestallman
        Jyrsa: What's the "thing to do to help get a job in software development" of 2015?
      • kavefish gets his popcorn
      • I think the site would be mostly a personal bio/CV/ and a showcase of my projects on github.
      • croepha has left the channel
      • Jyrsa
        gnudestallman, be relatively smart, overconfident in your own abilities and have a strong working ethic?
      • apollo13
        not sure if overconfident is such a good idea :)
      • Jyrsa
        might also need to learn or be learning programming
      • Dslegends joined the channel
      • apollo13, it's quite necessary as overconfident and hard working people can make shit happen that underconfident people would never try
      • lxer
        it also helps to be 22y/o, know nothing, but be just like everyone in the startup.
      • bobbyr
        bananaa gnudestallman web.py is abandonware btw
      • malgorath
        Did my question make sense even?
      • c4urself joined the channel
      • Jyrsa
        malgorath, sure. define it and import it.
      • apollo13
        Jyrsa: Maybe, but I often rather just have people how are confident and know what they can and don't overestimate theirself
      • malgorath
        Jyrsa: do you have an example you mean?
      • apollo13
        anyways, that's probably a topic for another channel
      • yoyoohrho has quit
      • garrettdreyfus has quit
      • bobbyr
        gnudestallman not to be glib, but the answer to your job question is know what you're doing
      • you will have a head up on like 75% of the workforce
      • Jyrsa
        malgorath, no i mean just do it. define an array outside the classes and refer to it in all the classes you want to use it in.
      • theslow1 joined the channel
      • malgorath, you might want to define it in a different file if you'll be importing it from a lot of places though
      • malgorath
        Jyrsa: thats what I was thinking, its gonna be a state/provience drop down box
      • can I make a variables.py file?
      • bananaa
        malgorath: you can make whatever you please :)
      • suvdeep has quit
      • tbaxter
        you may want a “locations” app.
      • yoyoohrho joined the channel
      • also, at one point there were states and provinces defined in django. localflavor as I recall. Not sure if they’re still there though.
      • bananaa
        gonna repeat a question from an hour ago, if somebody has any ideas
      • [19:58:59] <bananaa>I'm importing JSON data via deserialize, which is working ok. But im wondering if its possible to reference foreignkey data by nesting, instead of via get_by_natural_key? example: http://paste.ee/p/fGo8y
      • malgorath
        tbaxter: I have a few other "choices" fields I have to define for multiple forms