#django

/

      • anth0ny has quit
      • Isam_ joined the channel
      • Isam_
        Why this is not working in my URLconf: photos/(category|categories)/
      • carljm
        Isam_: define "not working"
      • Isam_
        OK, here's the full line: url(r'^photos/(category|categories)/(?P<id>\d+)/(?P<slug>\w+)/$', 'photos.views.category'),
      • I want category and categories to lead to the same view
      • mattmakai has quit
      • This is working: url(r'^photos/(category)/(?P<id>\d+)/(?P<slug>\w+)/$', 'photos.views.category'),
      • zontar has quit
      • atula has quit
      • okrutny
        @Isam: in my case sth like that works: url(r'^auctions/(?P<type>solutions|knowledge)/$', 'auction_list',
      • hwrd|work has quit
      • katsh has quit
      • xBBTx joined the channel
      • craigkerstiens has quit
      • craigkerstiens joined the channel
      • SmileyChris joined the channel
      • hwrd|work joined the channel
      • amr
        mlavin: how do you mean?
      • its directly under the static dir
      • arturrro has quit
      • luxgeek joined the channel
      • gauzmps joined the channel
      • hex`` joined the channel
      • mlavin
        amr: is that static directory in one of the applications or included in the STATICFILES_DIRS setting?
      • cocoloa joined the channel
      • luxgeek
        Hi all. been googling for days and not finding a resolution...have python 2.7 and django 1.4.2 setup and python is working fine. I do the >>import django and that's fine. I do >>print(django.get_version()) and get 1.4.2 back.
      • bahamas
        anyone familiar with south have an idea how I can convert a column to a new data type and the data that it contains?
      • luxgeek
        I then try to run django-admin.py startproject mysite and get a syntax error
      • Help!!
      • Why would I be getting that syntax error?
      • bahamas
        luxgeek: how do you try?
      • luxgeek
        (following the instructions from: https://docs.djangoproject.com/en/dev/intro/tut...)
      • bahamas
        paste the console session on dpaste
      • luxgeek
        From a python command prompt.
      • Stand by
      • bahamas
        that's incorrect
      • do it from a terminal
      • not from a python shell
      • jobelenus joined the channel
      • jobelenus
        the new class based view documentation doesnt seem to have any support (like the function based views did) for sending a specific mimetype… is this right, or is the documentation just missing this??
      • luxgeek
        Here is the dpaste: http://dpaste.com/820936/
      • bahamas: I WAS in a terminal, at the prompt, I type python and press enter to get into an interactive python env as the instructions say
      • -.-
      • SmileyChris
        er...
      • okrutny
        django-admin.py startproject myapp
      • from terminal not python as bahamas said
      • bahamas
        luxgeek: I'm looking at the instructions about creating a project and it doesn't say anything about entering the python shell
      • SmileyChris
        luxgeek: firstly, you should be using https://docs.djangoproject.com/en/1.4/intro/tut...
      • bahamas
        SmileyChris: yeah, he just linked that, but he's confused
      • arietis has quit
      • SmileyChris
        no he didn't
      • he linked to /dev/
      • bahamas
        ah, I missed the difference
      • SmileyChris
        but yes, the bigger issue is that luxgeek doesn't seem to actually be following the tutorial :P
      • atula joined the channel
      • luxgeek
        okrutny: So far it hasn't mattered what project name I've used, I get the same error
      • jpadilla has quit
      • SmileyChris
        luxgeek: we're still waiting to see what the error is
      • luxgeek: as has been said already, you don't run it from a python interpreter - just your standard command line
      • ah, i see where it says about entering the interpreter
      • jaddison
        I've often thought it would be better to default to the most recent stable version rather than dev of the django docs. Make it an explicit choice to see the dev docs. Too many issues seem to arise related to that… ;)
      • SmileyChris
        but yeah, exit that once you have verified django is installed
      • luxgeek
        exit
      • SmileyChris
        jaddison: it does
      • luxgeek has left the channel
      • jaddison: but i don't think the bottom right is anywhere near the right place to put the version switching
      • jaddison
        SmileyChris: Only if you go directly to docs.djangoproject.com
      • SmileyChris
        jaddison: or if you click "documentation" in the header from any page of dp.com
      • jaddison
        if you google for "template tags django", it will take you to the dev docs.
      • SmileyChris
        jaddison: so do some kind of cookie test? sounds messy
      • jaddison
        I didn't say it would be pretty… ;)
      • arietis joined the channel
      • But it would lead to less confusion.
      • neataroni has quit
      • mykul has quit
      • jobelenus
        the new class based view documentation doesnt seem to have any support (like the function based views did) for sending a specific mimetype… is this right, or is the documentation just missing this??
      • jaddison
        Just prevent search engines from indexing dev docs?
      • SmileyChris
        perhaps if it says "?from=olddocs" redirect
      • jaddison
        hehe
      • amr
        mlavin: pardon?
      • oh, no
      • SmileyChris
        i'm not sure why google is so crazy about that
      • flashingpumpkin has quit
      • amr
        its in the same place as the media dir is
      • SmileyChris
        lol, it's been like that for about 5 years
      • flashingpumpkin joined the channel
      • mattmcc
        olddocs. They just get better with age.
      • SmileyChris
        amr: well that's not a good place for them
      • atula has quit
      • amr
        i have manage.py in /x/ and static is under /x/static
      • and /x/media
      • jrickman joined the channel
      • is that an unsuitable location?
      • flashingpumpkin has left the channel
      • SmileyChris
        well no, that's fine
      • but how does django know about /x/static?
      • JJMalina joined the channel
      • amr
        STATIC_ROOT and MEDIA_ROOT
      • SmileyChris
        nope
      • sivy has quit
      • anything ending in _ROOT is an end-point -- not somewhere where you should put files directly
      • you want STATICFILES_DIRS
      • amr
        oh, interesting
      • bugger.
      • what's the purpose of STATIC_ROOT then?
      • SmileyChris
        collection point for your static files
      • amr
        OH
      • SmileyChris
        across apps & project
      • cocoloa
        this is not #matplotlib, but there may be more matplotlibbers around than in #matplotlib right now; i try to animate a scatter plot (multiple clusters in one scatter plot; each cluster is represented as a group of points with the same color); this is my current, disfunctional, approach: http://bpaste.net/show/EAMrkHckxhH3FFb9Lzfr/ it tries to animate just *one* cluster for now; but extending it to animate multiple subplots should be trivi
      • amr
        ahh, that makes sense
      • what on earth
      • SmileyChris
        amr: runserver doesn't need it though
      • seanbrant has quit
      • but it gives your real web server somewhere to serve static files from
      • cocoloa
        wron channel, very sorry!
      • *wrong
      • azbarcea joined the channel
      • amr
        SmileyChris: that makes sense
      • thanks :)
      • SmileyChris
        amr: no probs - it's a common confusion point
      • exit2
        is there a way to send data to the page from a view, w/o refreshing?
      • mattmcc
        Comet?
      • frequant has quit
      • exit2: Pulling from the client with ajax is somewhat simpler, but it's possible.
      • exit2
        mattmcc: I'm making a tic tac toe game and it's currently sending over the which box is clicked by the player and I want to be able to send back over a move from the AI. I think it would pretty elite if it didn't refresh :\
      • maybe socket.io
      • nimish_g has quit
      • amr
        ah bugger SmileyChris, im seeing the same issue
      • ToApolytoXaos joined the channel
      • 404 on /static/app.css
      • SmileyChris
        amr: i actually came in in the middle of your discussion - could you summarize your issue again please?
      • simensen
        How can I access mydict.key if key is mymodel.somefield ? mydict.mymodel.somefield does not work; mydict[mymmodel.somefield] does not work...
      • amr
        im getting a 404 on static files i know to be there
      • this is my setup:
      • luchenbill joined the channel
      • ah, hang on i see an error
      • jcarbaugh has quit
      • SmileyChris
        :)
      • amr
        hurrah!
      • i had site_root in staticfiles_dirs
      • thanks for the help :)
      • brainwarped
        is there a reason why isinstance wouldn't work in django 1.4?
      • mattmcc
        Considering it's a Python builtin, no.
      • mquasar has quit
      • SmileyChris
        i snuck in "isinstance = lambda *x: False" in a recent commit just to confuse you :D
      • jobelenus has quit
      • brainwarped
        mattmcc: thanks!
      • SmileyChris: this is an issue adopting some code from 1.1...
      • SmileyChris
        brainwarped: could you give some details regarding your issue?