#django

/

      • insejn has quit
      • jordanmessina has quit
      • xeberdee
        <link rel="stylesheet" type="text/css" href="/path/to/file.css">
      • works for me
      • twoolie
        cardboard: scratch that, just use <link rel="stylesheet" type="text/css" href=".."> everywhere
      • bmonty has quit
      • aarcane joined the channel
      • cardboard
        twoolie, Thanks! I can finally move on to something else, haha
      • xeberdee
        cardboard: did you collect the static files to the path for static?
      • cardboard
        xeberdee, no, what does that mean?
      • xeberdee
        cardboard: put the css and fstatic in the folder you name in the settings file, and then do - python manage.py collectstatic, which will pull all the static files and put them into the path mentioned in your settings file
      • insejn joined the channel
      • there are two paths - the one for static files, and the one the server uses to serve static files. collect - moves them where they need to go
      • Ronald_Reagan joined the channel
      • happyface joined the channel
      • bwreilly has quit
      • cardboard: put the full path to the Static root in your settings too -
      • cardboard
        xeberdee, I'm planning putting this project on Heroku
      • So I'm not sure what to put for the full path..
      • tapan joined the channel
      • jordanmessina joined the channel
      • insejn has quit
      • Laybunz joined the channel
      • BiskitB0y joined the channel
      • twoolie
        xeberdee: that wasn't his problem. He won't have to deal with that until he's ready to put it on heroku
      • cardboard
        ;)
      • Ron4ldinho has quit
      • NimeshNeema joined the channel
      • bwreilly joined the channel
      • bwreilly has quit
      • iqualfragile_ has quit
      • xeberdee
        If django is using my settings then MEDIA_ROOT is set, how do I reference it in views.py? I can do full path but MEDIA_ROOT fails, settings.MEDIA_ROOT also
      • jarshwah joined the channel
      • knite has quit
      • FunkyBob
        o/
      • schinckel has quit
      • Left_Turn has quit
      • insejn joined the channel
      • berto- has quit
      • ovnicraft has quit
      • hvdklauw has quit
      • xeberdee
        anyone? the docs are looooong and not clear for a total newbie, all the steps involved for something that I would have thought simple - display a list of files. Obviously not that simple.
      • insejn has quit
      • twoolie
        you don't reference your media_root directly
      • you'll want to interact with it through a storage engine
      • xeberdee: especially if you're deploying to heroko, which doesn't let you store media on your worker box
      • hvdklauw joined the channel
      • check out django-storages
      • xeberdee: also, if this is a toy project, reconsider using heroku. It's expensive and restrictive. Find a nice django-friendly VPS host, like webfaction.
      • cyong joined the channel
      • xeberdee
        twoolie: I'm rather trying to just manage files with a browser, attach some metadata and do some simple os related stuff at media_root. So it's not really cloud based type of application.
      • twoolie: on a closed network serving 5 machines with large storage area.
      • JennyS joined the channel
      • JainAmber has quit
      • Laybunz has quit
      • JainAmber joined the channel
      • jeffisabelle joined the channel
      • FunkyBob
        wait, where did cloud stuff come into the discussion?
      • knite joined the channel
      • jnoob22 joined the channel
      • xeberdee
        FunkyBob: I supposed that Amazon, Apache Libcloud, Rackspace cloudfiles etc were cloud based services
      • FunkyBob reads back
      • FunkyBob
        even if you're not, you should work through the storage engine API
      • ppr joined the channel
      • insejn joined the channel
      • peper has quit
      • ustunozgur joined the channel
      • xeberdee
        FunkyBob: I'm really a beginner with this, as you might have noticed. I've used python scripts to manage video files before, I'm hoping to integrate django so that I can keep track of file status with a database.
      • FunkyBob
        xeberdee: well, you can just use os.path and os.listdir and so on to get a list of files...
      • the advantage of Django's storage API is that when, in the future, you start using remote storage [sounds like you already are?] your code won't need to change
      • moneydouble has quit
      • cyong has quit
      • lduros has quit
      • xeberdee
        FunkyBob: that's what I'm doing now, django and apache server has a samba share media root over gigabit, and I just put in the full path. I was kinda hoping to store paths to media in django admin and pull them out of the DB.
      • bmonty joined the channel
      • hwrd|work joined the channel
      • BiskitB0y has quit
      • Titanomachy has quit
      • FunkyBob
        xeberdee: so this is separate from MEDIA_ROOT / MEDIA_URL... being where Django would expect to [by default] store user uploads, etc ?
      • Titanomachy joined the channel
      • TeeTime has quit
      • bwreilly joined the channel
      • Ariel_Calzada joined the channel
      • cyong joined the channel
      • Titanomachy has quit
      • Titanomachy joined the channel
      • coregonus joined the channel
      • twikz joined the channel
      • twoolie
        xeberdee: sorry, i got you confused with cardboard who said he was going to deploy to heroko
      • xeberdee
        FunkyBob: I'm not so worried about uploads, and I don't want to involve the webserver with anything bigger than paths and css files etc. I want python to do all the work moving files between storage islands on the LAN
      • twoolie
        cardboard: that advice above was for you
      • cardboard
        twoolie, sweet, thanks
      • FunkyBob
        xeberdee: are these files at all served by the web server to users?
      • luyikei_ joined the channel
      • xeberdee: the way you're speaking makes me think there's some lurking complexity to your query I'm not understandig
      • xeberdee
        FunkyBob: No
      • jeffisabelle has quit
      • FunkyBob
        ok
      • so as yet, no particular advantage to using the storage api, except avoiding future pains which may never occurr
      • Titanomachy has quit
      • xeberdee
        FunkyBob: I'm just wanting to serve info about the files on storage, group them into projects, move them around etc
      • Titanomachy joined the channel
      • ustunozgur has quit
      • FunkyBob: around 'on the server'
      • rideh joined the channel
      • zeograd has quit
      • FunkyBob: Ie. I get dumped tetabytes of files into a path on the server - then I transcode with FFMPEG scripts using python - I need a web end to make the whole thing a little more user friendly.
      • FunkyBob
        ok
      • so which part is troubling you?
      • cronin joined the channel
      • xeberdee
        FunkyBob: well I just started with Django and I'm just struggling with the whole model, template thing
      • dethos joined the channel
      • lduros joined the channel
      • twoolie
        xeberdee: what part exactly are you struggling with?
      • k_sze[work] joined the channel
      • Titanomachy has quit
      • Titanomachy joined the channel
      • maroloccio has quit
      • FunkyBob
        xeberdee: request comes in, url patterns maps it to a view, view generates response
      • this is the core of django
      • as you'll notice, no mention of templates or models in that
      • astralab has quit
      • your view may choose to use a template to help generate the response content...
      • your view may also use models to help accessing data in your DBMS
      • H25 has quit
      • BiskitB0y joined the channel
      • xeberdee
        FunkyBob: My view can do lots of other stuff too - I was hoping to get the view to do the scripting I have now.
      • FunkyBob
        well, since it's all just python, it can
      • paultag has left the channel
      • estebistec joined the channel
      • dethos has quit
      • Guest42677 joined the channel
      • xeberdee
        FunkyBob: So I need to sort out what response (info) is kept in the database and available for the server
      • FunkyBob
        why is anything kept in the DB?
      • xeberdee
        FunkyBob: right now I have transcode logs, dates etc.
      • FunkyBob
        ok
      • xeberdee
        FunkyBob: I suppose they are ok as files still
      • moneydouble joined the channel
      • FunkyBob
        I've used django before with no DBMS... just flat files for everything
      • cardboard has quit
      • astralab joined the channel
      • but if you have reason to store stuff in a DB, by all means
      • so, you've done the tutorial in the docs, right?
      • epicowl joined the channel
      • xeberdee
        FunkyBob: Yep - it was a while ago though, it goes as far as form post and get.
      • hwrd|work has quit
      • FunkyBob: which is probably all I need... :)
      • moneydouble has quit
      • ls3 joined the channel
      • FunkyBob
        even once you start using web-based APIs, get/post still go a long way