Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

641 lines (605 sloc) 63.282 kb
use heroku logs
(09:36:25 PM) pearkes: midnightcoffee is this for env variables?
(09:37:08 PM) midnightcoffee: pearkes, yes. I'm trying to figure out how to keep my "SECRET_KEY" (from flask) ... secret
(09:37:40 PM) pearkes: midnightcoffee heroku config:add SECRET_KEY=yoursecretkey
(09:37:52 PM) pearkes: that sets it in the app and keeps it out of git!
(09:53:46 PM) midnightcoffee: I need a flask/heroku mentor it seems. That worked after i commented out the from_env part as well.
(09:53:56 PM) pearkes: midnightcoffee cool!
(09:54:21 PM) pearkes: I recommend doing env variables something like this: https://github.com/pearkes/lyre/blob/master/settings.py
(09:54:43 PM) pearkes: You can then add defaults, for example, on the port
(09:54:58 PM) pearkes: So if the port doesn't exist in the env, it defaults to 5000 (for development)
(09:57:49 PM) midnightcoffee: pearkes, is that possible because of how heroku works?
(09:58:27 PM) pearkes: midnightcoffee Nope, that's just the python .get() method. Its defaults to None if there isn't a default set.
(09:58:35 PM) pearkes: Heroku automatically sets a env variable called PORT
(09:59:02 PM) pearkes: So when it runs os.environ.get('PORT', 5000), it just gets the value of the PORT in the env.
(09:59:13 PM) midnightcoffee: pearkes: oh, thats brilliant.
(09:59:19 PM) pearkes: But on development, you'd probably not have that env variable, so it would fall back to 5000
use multiple procfiles
(01:46:30 PM) pearkes: midnightcoffee guinicorn is an http server - usually overkill for development. It also doesn't have flask's (werkzeugs, really) awesome built-in debugger
(01:46:41 PM) pearkes: If I were you
(01:46:45 PM) pearkes: I would make two procfiles
(01:46:48 PM) pearkes: one called Procfile
(01:46:52 PM) pearkes: For Heroku
(01:46:52 PM) maletor [~maletor@c-69-181-24-86.hsd1.ca.comcast.net] entered the room.
(01:47:00 PM) pearkes: and one called Procfile.dev
(01:47:17 PM) pearkes: in Procfile.dev you can put web: python app.py for example
(01:47:31 PM) pearkes: and then locally, run this:
(01:47:42 PM) pearkes: foreman start --procfile Procfile.dev
heroku limitations possible apache
2012-11-06T03:58:18 <midnightcoffee> I'm trying to build a site which builds and stores matplotlib graphs, should i consider using amazons s3 service to store the images or .... what are my options?
2012-11-06T03:58:20 <herdrick> soulseekah: that's not a flaw, that's a feature for read-only data
2012-11-06T03:58:39 <cdunklau> midnightcoffee: where does your app live?
2012-11-06T03:58:56 <GrahamDumpleton> soulseekah: Read http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading Is for mod_wsgi but the issues are common for any WSGI server.
2012-11-06T03:58:59 <herdrick> soulseekah: ok, thanks for the warning. i won't tinker with it.
2012-11-06T03:59:34 <midnightcoffee> cdunklua, sorry forgot to add that, i'm deploying with heroku
2012-11-06T03:59:55 <cdunklau> midnightcoffee: then s3 is a good bet.
2012-11-06T04:00:02 <soulseekah> GrahamDumpleton, will certainly do even if I don't use mod_wsgi; anything particularly stupid I said that made you point out that to me?
2012-11-06T04:00:18 *** atula has quit IRC
2012-11-06T04:00:34 <cdunklau> midnightcoffee: there's flask-s3 that was recently made, but it sounds like you'll need to upload from inside the app with workers, ya?
2012-11-06T04:00:51 <GrahamDumpleton> It explains some things in the context of mod_wsgi, but the issues are the same for other WSGI servers. Read it and you will see what I mean. Talks about data sharing processes, concurrency etc.
2012-11-06T04:00:56 <cdunklau> midnightcoffee: get cozy with boto. it's nice.
2012-11-06T04:01:09 <soulseekah> GrahamDumpleton, will do, thanks.
2012-11-06T04:01:31 <bob2> herdrick, no, you'd want it out of process entirely
2012-11-06T04:01:36 *** atula has joined #pocoo
2012-11-06T04:01:47 <bob2> herdrick, my suggestion was just to move the huge delay from import time to first access time
2012-11-06T04:02:01 <herdrick> bob2: right, so a DB or something
2012-11-06T04:02:08 <soulseekah> herdrick, you may like this too http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading#Sharing_Of_Global_Data good stuff
2012-11-06T04:02:20 <cdunklau> midnightcoffee: overall, though, you probably should host that another way. like with a platform that you can use well with static files
2012-11-06T04:02:57 <bob2> your current way at least means the big delay happens before the wsgi main loop is entered
2012-11-06T04:03:04 <bob2> so you won't pause during requests
2012-11-06T04:03:11 <herdrick> bob2: i find it's quicker to dev without a db. add a db as needed. but it sounds like that workflow won't work with Flask.
2012-11-06T04:03:28 <cdunklau> midnightcoffee: i suppose heroku can do this for you, but you might just want to roll your own with EC2
2012-11-06T04:03:42 <cdunklau> midnightcoffee: apache, nginx, or the like
2012-11-06T04:03:44 <herdrick> soulseekah: thanks, i'll read that
2012-11-06T04:03:57 *** macabre has quit IRC
2012-11-06T04:04:14 <bob2> it's not related to flask at all
2012-11-06T04:04:16 <soulseekah> GrahamDumpleton, good read, it all makes perfect sense of course.
2012-11-06T04:04:27 <herdrick> so i'm bummed. going to have to add a DB or go back to web.py.
2012-11-06T04:04:44 <midnightcoffee> cdunklau, thanks. I'm trying to digest your advice, this is all new to me
2012-11-06T04:04:44 <bob2> :-/
2012-11-06T04:04:51 <bob2> in what way is webpy any different?
2012-11-06T04:05:11 <bob2> you've made import supremely expensive, that will be a problem in any wsgi framework
2012-11-06T04:05:17 <soulseekah> webpy's dev. server seems to replace the WSGI app in place, without reloading the interpreter
2012-11-06T04:05:18 <cdunklau> midnightcoffee: how quickly do you have to ramp this up to a large number of concurrent requests?
2012-11-06T04:05:40 <GrahamDumpleton> In place module reloading is very very error prone.
2012-11-06T04:05:45 <bob2> yowzer
2012-11-06T04:05:48 <herdrick> above i mentioned that web.py does not reload the app's dependencies even in debug mode. you have to reload(some_module) yourself
2012-11-06T04:05:59 <soulseekah> herdrick, intersting
2012-11-06T04:06:12 <herdrick> bob2: my last comment was for you
2012-11-06T04:06:24 <bob2> so it's just a dev mode issue then?
2012-11-06T04:06:47 <midnightcoffee> cdunklau, were hoping to display around 24 images in about 2 weeks. I'm trying to plan for many more
2012-11-06T04:06:49 <soulseekah> doesn't web.py use the cherrypy server?
2012-11-06T04:06:55 <cdunklau> midnightcoffee: because if it isn't for a while, i'd just work on an apache server.
2012-11-06T04:07:41 <cdunklau> midnightcoffee: wait is the app going to generate charts live?
2012-11-06T04:07:50 <bob2> use_reloader=False to app.run()
2012-11-06T04:08:29 <bob2> but remember if you do use reload() that it does exactly one thing and that is load a new instance of a module and return it, it leaves references to the original laying around etc
2012-11-06T04:10:14 *** skot has joined #pocoo
2012-11-06T04:10:27 <soulseekah> maybe you can change https://github.com/mitsuhiko/werkzeug/blob/master/werkzeug/serving.py#L559 the reloader loop and have it reload() your modules and replace the app
2012-11-06T04:10:33 <midnightcoffee> cdunklau, cdunklau yes, i'm hopeing the user will be able to build a chart from the app. Then i would save the image.
2012-11-06T04:10:36 <soulseekah> but that's a crazy hack
2012-11-06T04:11:06 <soulseekah> whenever a reload is detected, that will have the same behavior as web.py then
2012-11-06T04:11:12 <bob2> you can't blindly use reload(), it needs to be done very carefully in an appspecific way
2012-11-06T04:11:20 *** R_Macy has quit IRC
2012-11-06T04:11:40 <soulseekah> without any doubt
2012-11-06T04:13:50 <cdunklau> midnightcoffee: yeah i would build that on your own hardware, or an EC2 instance or something
2012-11-06T04:15:03 *** bjazz has quit IRC
2012-11-06T04:15:20 <cdunklau> midnightcoffee: since it'll be far easier to just write to disk from the app, and serve the written file from a normal web server
2012-11-06T04:15:23 <soulseekah> herdrick, https://github.com/webpy/webpy/blob/master/web/application.py#L687 this is web.py's reloader
2012-11-06T04:15:40 <soulseekah> it looks for changed files and reloads only them
2012-11-06T04:16:33 <soulseekah> with enough time you can port it to wz if you really want to, just for the fun of it though
2012-11-06T04:17:17 <midnightcoffee> cdunklau, by "build on your own hardware" do you mean set up my own server?
2012-11-06T04:17:26 <bob2> yowzer
2012-11-06T04:17:29 <bob2> that's fraught
2012-11-06T04:17:35 <cdunklau> midnightcoffee: yeah. apache or nginx
2012-11-06T04:17:50 <cdunklau> midnightcoffee: or something else
2012-11-06T04:18:04 <herdrick> soulseekah: thanks. no thanks on the porting, though. maybe i'll have to be a good soldier and use an external DB. ;)
2012-11-06T04:19:10 <soulseekah> oh do be so smart and do the latter
2012-11-06T04:20:51 <midnightcoffee> cdunklau, thanks a ton, let me see if i understand. I would get information from the user -> store it in my heroku db -> have my sever access that db and build the chart then -> something -> profit?
2012-11-06T04:20:58 *** anth0ny has quit IRC
2012-11-06T04:21:19 <cdunklau> midnightcoffee: no, more with the "not using heroku" thing
2012-11-06T04:22:34 *** alekzvik has quit IRC
2012-11-06T04:22:50 <cdunklau> midnightcoffee: you can't depend on the disk with heroku, at lease not after one request
2012-11-06T04:24:03 <herdrick> soulseekah: bob2: ah. so web.py might not reliably work the way I've been using it, either. great.
2012-11-06T04:25:09 <soulseekah> herdrick, they don't advertise it as unstable, but I believe GrahamDumpleton
2012-11-06T04:25:45 <herdrick> from that doc soulseekah: sent me: "data will need to be stored in a way that it can be accessed from multiple child processes. ... [ex.] in shared memory accessible by all child processes."
2012-11-06T04:26:10 *** tulioz has quit IRC
2012-11-06T04:26:15 <soulseekah> i.e. a database, on disk or in memory
2012-11-06T04:26:29 <herdrick> right. but how to get shared memory accessible by all child processes?
2012-11-06T04:26:46 <soulseekah> it's the job of the "database" to provide an interface to its data of course
2012-11-06T04:27:33 <herdrick> no, the shared memory option
2012-11-06T04:27:57 <soulseekah> the database is the "shared memory"
2012-11-06T04:28:25 <soulseekah> you can use and allocate shmem yourself of course if you're feeling adventerous
2012-11-06T04:28:28 <soulseekah> and write your own apis
2012-11-06T04:29:01 <herdrick> what i'm saying is that just keeping memory in a module var is damned convenient for dev. different processes will have their own copy of course. but that's often ok.
2012-11-06T04:29:06 <soulseekah> you can of course try http://poshmodule.sourceforge.net/ and the sorts
2012-11-06T04:29:32 *** shiver has quit IRC
2012-11-06T04:29:33 <herdrick> posh - interesting
2012-11-06T04:29:43 <soulseekah> you might also like something more low level like http://docs.python.org/2/library/multiprocessing.html#sharing-state-between-processes
2012-11-06T04:30:18 *** tdignan has left #pocoo
2012-11-06T04:30:31 <soulseekah> you might like to write a shared library instead
2012-11-06T04:30:36 *** Fandekasp has quit IRC
2012-11-06T04:30:46 <soulseekah> and dlopen it, us stuff from it
2012-11-06T04:31:16 <herdrick> is there a way for me to specify that i just want a single process / single thread with a WSGI server?
2012-11-06T04:31:38 <soulseekah> you can try http://pypi.python.org/pypi/posix_ipc/0.5.4 too
2012-11-06T04:32:08 <soulseekah> sure
2012-11-06T04:32:20 <herdrick> yeah, that's just implementing my own in-memory db
2012-11-06T04:32:35 <herdrick> would rather just use redis or something
2012-11-06T04:32:59 <midnightcoffee> cdunklau, is this relevant to what you mean by "cannot depend on the disk wit heroku?"https://devcenter.heroku.com/articles/read-only-filesystem
2012-11-06T04:33:02 *** skot has quit IRC
Heroku limitations s3 possible
(10:56:53 PM) midnightcoffee: From the heroku website " Your app is compiled into a slug for fast distribution across the dyno manifold. The filesystem for the slug is read-only, which means you cannot dynamically write to the filesystem for semi-permanent storage.", i take it this means that heroku isn't a good choice if i want my web app to dynamically build and store matplotlib charts for people to view?
(10:58:53 PM) Xitium [~Xitium@static-50-43-40-207.bvtn.or.frontiernet.net] entered the room.
(10:59:45 PM) Xitium: Hi, I have been trying to work thru the online book at railstutorial.org, and everything seems to go well until it has me install the Heroku toolbelt. After that rails seems to break, what am I doing wrong?
(11:00:36 PM) robmorrissey left the room (quit: Quit: Computer has gone to sleep.).
(11:01:23 PM) tinybluepixel left the room (quit: Ping timeout: 260 seconds).
(11:11:19 PM) R_Macy [~R_Macy@c-69-137-70-11.hsd1.tn.comcast.net] entered the room.
(11:11:42 PM) Progster left the room (quit: Read error: Operation timed out).
(11:15:08 PM) The account has disconnected and you are no longer in this chat. You will be automatically rejoined in the chat when the account reconnects.
(11:15:50 PM) The topic for #heroku is: Docs at https://devcenter.heroku.com || Current status at https://status.heroku.com || Support at https://support.heroku.com
(11:23:52 PM) dnnsmanace left the room (quit: Remote host closed the connection).
(11:24:11 PM) rburton- [~rburton-@96.24.76.25] entered the room.
(11:24:26 PM) rburton-: re
(11:24:37 PM) rburton-: How does a database upgrade work on Heroku?
(11:27:30 PM) justinmcp [~justinmcp@ppp118-208-143-23.lns20.bne1.internode.on.net] entered the room.
(11:30:04 PM) dmclain [~textual@75-43-17-191.lightspeed.austtx.sbcglobal.net] entered the room.
(11:30:33 PM) aetcore_ left the room (quit: Read error: Connection reset by peer).
(11:30:46 PM) aetcore [~aetcore@120.148.163.228] entered the room.
(11:32:04 PM) bobthecow: midnightcoffee: yes and no.
(11:32:07 PM) bobthecow: there are ways to do it.
(11:32:46 PM) gthank [~gthank@unaffiliated/gthank] entered the room.
(11:33:03 PM) bobthecow: you can write the files to a scratch directory then, for example, dump 'em into redis or mongo (gridfs) to serve 'em back.
(11:33:12 PM) gthank: What's the best way to run alembic migrations on my Heroku app?
(11:37:00 PM) midnightcoffee: bobthecow, i'm rather green. For something of this nature would be advisable to 1. attempt something of the nature you suggested. 2. try building my webapp using apache 3. abandon the idea of dynamically building the charts live.
(11:38:24 PM) zrail: midnightcoffee: you could also build them into a scratch directory and upload to S3, then serve the S3 URL
(11:38:34 PM) zrail: midnightcoffee: that's basically what docverter does and it works well
(11:39:23 PM) bobthecow: midnightcoffee: what zrail says isn't a bad idea at all.
(11:39:54 PM) rburton-: anyone here work at Heroku?
(11:40:07 PM) zrail: nope
(11:40:43 PM) midnightcoffee: zrail, Where could i read more about this option, my googling is coming up short
(11:40:53 PM) zrail: midnightcoffee: are you using ruby?
(11:41:04 PM) midnightcoffee: zrail, python flask
(11:41:07 PM) rburton-: Hmm I near their HQ
(11:41:15 PM) rburton-: I would love to drop by their office
(11:42:12 PM) zrail: midnightcoffee: http://docs.pythonboto.org/en/latest/s3_tut.html
(11:42:40 PM) zrail: rburton-: probably send them an email first, but i would be astounded if they said no
(11:42:57 PM) rburton-: I plan to :)
(11:43:24 PM) zrail: midnightcoffee: basically, create a bucket in the s3 interface and then follow the directions under "Storing Data"
(11:43:39 PM) zrail: midnightcoffee: er, in the AWS console
(11:44:59 PM) dmclain left the room (quit: Quit: Computer has gone to sleep.).
(11:45:06 PM) bobthecow left the room ("Linkinus - http://linkinus.com").
(11:49:33 PM) midnightcoffee: zrail, thanks a bunch. I'm obviously in over my head here. I was talking to someone in the pocoo (flask/python) channel and he said : " you can't depend on the disk with heroku, at lease not after one request". Your suggestion would address this concern?
(11:50:53 PM) zrail: midnightcoffee: that person is correct, in so far as the disk is basically one big tempdir that's wiped when the dyno is killed, which will happen automatically at least once per day
(11:51:29 PM) zrail: midnightcoffee: if you build your charts and upload them to S3, then return the S3 URL as the image URL, you'll be able to serve that image several times
(11:52:19 PM) midnightcoffee: zrail, ah so i would have to build the charts ... locally?
(11:52:32 PM) zrail: midnightcoffee: no, you could build them on the fly
(11:52:37 PM) zrail: midnightcoffee: and then just stuff them on S3
(11:53:26 PM) zrail: so, 1) request comes in for /some-fancy-chart. 2) you render the chart, upload to S3 3) you return some HTML with an <img> tag pointing at the S3 URL
(11:54:26 PM) macmartine [~macmartin@c-24-21-112-60.hsd1.or.comcast.net] entered the room.
(11:56:26 PM) midnightcoffee: zrail, gotcha. I'm probable not understanding the problem in the first place. I had assumed that "can't depend on the disk..." was suggesting that because heroku wouldn't be able to handle multiple ppl trying to create charts at once.
(11:56:53 PM) zrail: midnightcoffee: oh, no not at all. heroku disks are really fast
(11:57:08 PM) zrail: midnightcoffee: but they're temporary
(11:57:26 PM) midnightcoffee: zrail, oh...
(11:57:35 PM) zrail: that's why you put the charts on S3
(11:57:39 PM) zrail: S3 is permanent
(11/06/2012 12:02:43 AM) midnightcoffee: zrail, that makes more sense. Great! Well thanks-a-ton. i wish i could buy you a beer or something. One of the things i love about this profession/lifestyle is the community.
(12:02:50 AM) zrail: :)
(12:02:52 AM) zrail: no worries
s3 boto StringIO
-check book marks
(02:28:32 PM) doobeh: midnightcoffee: that thefort page is mine actually-- if you're creating files on the server, you can just adapat the s3_upload function to store it in s3
(02:32:07 PM) monocult [~monocult@f048233101.adsl.alicedsl.de] entered the room.
(02:32:22 PM) braoru left the room (quit: Ping timeout: 246 seconds).
(02:36:48 PM) doobeh: though if the processing power isn't much, maybe just store the values you want to create the charts?
(02:37:06 PM) midnightcoffee: doobeh, great, hats how i interpreted it as well. I was curious if the flask-s3 extension made it easier. As far as i can tell the author: Edwardr, plans to make that possible ...in the future. "One of the next stages will be to integrate uploads to S3 into the extension, so keep an eye out :-)" - Edwardr . Wonderful site btw.
(02:37:28 PM) Karmaon left the room (quit: Read error: Connection reset by peer).
(02:37:55 PM) Karmaon [~Karmaon@unaffiliated/karmaon] entered the room.
(02:38:52 PM) cdunklau left the room (quit: Quit: leaving).
(02:39:58 PM) doobeh: midnightcoffee: the set_contents_from_filename might be useful to you, instead of the set_contents_from_string in the example
(02:40:36 PM) fretscha [~fretscha@134-57.192-178.cust.bluewin.ch] entered the room.
(02:42:06 PM) Odra left the room (quit: Ping timeout: 264 seconds).
(02:42:08 PM) Joes [~Miranda@213.111.90.25] entered the room.
(02:42:36 PM) doobeh: https://gist.github.com/4027001 maybe
(02:43:48 PM) doobeh: where filename is the path to the temporarynamedfile (or whatever)
(02:45:23 PM) rehandalal left the room (quit: Quit: rehandalal).
(02:48:55 PM) markd2 left the room (quit: ).
(02:49:17 PM) m3thyl left the room (quit: Quit: Ex-Chat).
(02:51:30 PM) midnightcoffee: doobeh, I believe the whatever that i'm using in my code is a is a StringIO instance. Which i believe helps the object behave like a file to other functions.
(02:56:38 PM) weaver_ left the room (quit: Ping timeout: 260 seconds).
(02:56:41 PM) weaver left the room (quit: Ping timeout: 245 seconds).
(02:59:59 PM) doobeh: oh, then you'll just need to pick a filename yourself https://gist.github.com/4027108
(03:00:40 PM) teebes [~teebes@216.30.179.54] entered the room.
(03:01:16 PM) weaver [~azazello@76-191-184-242.dedicated.static.sonic.net] entered the room.
(03:01:18 PM) weaver_ [~azazello@76-191-184-242.dedicated.static.sonic.net] entered the room.
(03:02:42 PM) Seveas [~Seveas@ubuntu/member/seveas] entered the room.
(03:03:35 PM) midnightcoffee: doobeh, great i'll hack away at this for a while see what comes of it.
(03:03:36 PM) jpadilla [~jpadilla@173.215.151.61] entered the room.
(03:04:51 PM) gabrielpjordao [~gabrielpj@177.19.218.200] entered the room.
Corresponding code ->
stringio_object = your_string_io_object
destination_filename = 'whatever'
# Connect to S3
conn = boto.connect_s3(app.config["S3_KEY"], app.config["S3_SECRET"])
b = conn.get_bucket(app.config["S3_BUCKET"])
# Upload the File
sml = b.new_key("/".join([app.config["S3_UPLOAD_DIRECTORY"],destination_filename]))
sml.set_contents_from_string(stringio_object.getvalue())
# Set the file's permissions.
sml.set_acl(acl)
(12:07:45 PM) dampxf: I'm trying to wrap my head around database-migrations in the context of my flask-built-app that lives on heroku. I was planning on using sql-alchemy to help manage the database. Can it really be as simple as -> https://devcenter.heroku.com/articles/migrating-data-between-plans? Will other tools such as sqlalchemy-migrate even be relevent if i just migrate between two postgres db's?
(12:08:52 PM) zrail: midnightcoffee: there's multiple meanings for the term "migration". there's migrating between schema versions, where you add or remove tables, columns, indexes, etc
(12:09:11 PM) zrail: midnightcoffee: and then there's migrating between heroku database instances, which is what that article is talking about
(12:09:28 PM) zrail: sqlalchemy-migrate will help you do the former
(12:10:53 PM) dampxf: zrail, how would you do the former without doing the later? (if that makes sense)
(12:12:02 PM) zrail: midnightcoffee: postgresql has built-in facilities for making changes to the database while it's running. you typically would only ever have to move between database instances when you outgrow your current limits.
(12:12:39 PM) zrail: midnightcoffee: you can add and remove whole tables, columns, and indexes inside of a database transaction in postgresql
(12:13:16 PM) danieldock left the room (quit: Quit: Leaving...).
(12:15:23 PM) dampxf: zrail, so i won't need to use migration in order to add,remove tables,comlumns etc..?
(12:15:43 PM) zrail: you won't need to use a heroku database migration like that article describes
use models dummy!
(08:49:20 PM) dampxf: is the "special g object" usable with flask-sqlalchemy? I'm trying to figure out how to retrieve information from my database
(08:50:40 PM) dampxf: i think not...
(08:51:36 PM) bergerx___ left the room (quit: Ping timeout: 240 seconds).
(08:51:58 PM) cdunklau: midnightcoffee: just query off the models
(08:52:26 PM) mpc1000 [6c19bf8c@gateway/web/freenode/ip.108.25.191.140] entered the room.
(08:52:32 PM) cdunklau: midnightcoffee: BlogPost.query.all()[-5:]
(08:52:37 PM) cdunklau: errr
(08:52:46 PM) cdunklau: midnightcoffee: BlogPost.query.all()[:5]
(08:53:48 PM) bergerx___ [~bergerx@24.133.145.199] entered the room.
(08:54:00 PM) ryantology left the room (quit: ).
(08:56:06 PM) mpc1000: soulseekah: heya, you around?
(08:57:54 PM) dampxf: cdunklau, How would i retrieve the data for the purposes of using it in my application though. How are you accessing "BlogPost". The only thing i have found is the exmaple at the bottem of http://flask.pocoo.org/docs/patterns/sqlalchemy/ using create_engine, MetaData.
(08:59:00 PM) ryantology [~ryantolog@unaffiliated/thinline] entered the room.
(08:59:24 PM) kracekumar left the room (quit: Ping timeout: 252 seconds).
(08:59:25 PM) bergerx___ left the room (quit: Ping timeout: 246 seconds).
(09:00:26 PM) cdunklau: midnightcoffee: read the docs for the extension itself
(09:00:35 PM) cdunklau: midnightcoffee: http://packages.python.org/Flask-SQLAlchemy/
(09:00:55 PM) mpc1000: With flask I was under the impression that if the route doesn't exist that flask woud return a 404. Is this correct?
(09:01:11 PM) cdunklau: midnightcoffee: it should, yes
(09:01:15 PM) cdunklau: errr, midnightcoffee
(09:01:18 PM) cdunklau: errr mpc1000
(09:01:22 PM) cdunklau: there we go
(09:01:24 PM) dampxf: errr
(09:01:32 PM) mpc1000: cdunklau: :P
(09:01:41 PM) cdunklau: mpc1000: is it not?
(09:01:53 PM) mpc1000: cdunklau: yup. Everything is 200 OK.
(09:01:54 PM) N30N left the room (quit: Ping timeout: 240 seconds).
(09:02:14 PM) mpc1000: I just requested /adsgfd;glfkdgf;;fdlgkfg and got an empty 200 response
(09:02:20 PM) cdunklau: mpc1000: uuuh
(09:02:26 PM) cdunklau: mpc1000: your code?
(09:02:46 PM) cdunklau: mpc1000: heck, just grep for app\.route and pastebin that
(09:03:16 PM) mpc1000: cdunklau: I'm looking at it now because last night I implemented a 404 handler (not sure if that is eating it somehow)
(09:04:01 PM) pjenvey- left the room (quit: Quit: ZNC - http://znc.sourceforge.net).
(09:04:04 PM) mpc1000: cdunklau: that was it... 404handler was doing exactly what I told it too...
(09:04:13 PM) N30N [~N30N@APoitiers-156-1-139-80.w86-199.abo.wanadoo.fr] entered the room.
(09:04:13 PM) pjenvey [~pjenvey@underboss.org] entered the room.
(09:04:17 PM) cdunklau: mpc1000: ?
(09:05:04 PM) bergerx___ [~bergerx@24.133.145.199] entered the room.
(09:05:18 PM) mpc1000: cdunklau: I hada 404 handler that returned werkzeug.environ (which was empty) so any 404 requests were coming back 200 empty (It was late and I forgot to add the 404 to set the proper status code)
(09:05:44 PM) markd2 [~markd2@h219.185.88.75.dynamic.ip.windstream.net] entered the room.
(09:06:05 PM) cdunklau: mpc1000: whoops!
(09:06:53 PM) mpc1000: cdunklau: do you know how/where flask does the slash/noslash url rerouting?
(09:07:07 PM) mpc1000: I thought it might 302 redirect but it's not doing that...
(09:08:12 PM) cdunklau: mpc1000: 301, so your browser has it cached
(09:08:27 PM) bergerx_ [~bergerx@24.133.145.199] entered the room.
(09:08:38 PM) mpc1000: cdunklau: I was curling from on the host, hitting the wsgi app direct
(09:08:52 PM) cdunklau: mpc1000: hmmm
(09:08:58 PM) cdunklau: mpc1000: is it public?
(09:09:07 PM) mpc1000: it can be
(09:09:31 PM) cdunklau: mpc1000: try using requests.get('whateverurlnoslash', follow_redirects=False)
(09:10:14 PM) cdunklau: mpc1000: or make it public and shoot me the url
(09:11:28 PM) ryantology left the room (quit: ).
(09:12:36 PM) bergerx___ left the room (quit: Ping timeout: 265 seconds).
(09:13:38 PM) mpc1000: cdunklau: messaged ya
(09:14:47 PM) cdunklau: mpc1000: why are you doing rewrites at the webserver?
(09:15:03 PM) ryantology [~ryantolog@unaffiliated/thinline] entered the room.
(09:15:14 PM) cdunklau: mpc1000: ah
(09:15:25 PM) cdunklau: mpc1000: your route has /t/<track>/events
(09:15:41 PM) cdunklau: mpc1000: if you want /t/<track>/events/ to work, you need to do it that way
(09:15:45 PM) dampxf: cdunklau: flask.ext.sqlchemy.Model.query?
(09:15:59 PM) joshfinnie left the room (quit: Read error: Connection reset by peer).
(09:16:29 PM) cdunklau: mpc1000: http://flask.pocoo.org/docs/api/#url-route-registrations
(09:16:36 PM) cdunklau: mpc1000: read the bit about trailing slashes
(09:16:38 PM) mpc1000: cdunklau: I was seeing weird slowness with subdomain routing in flask (not sure why) so I tried this approach, essentially namespace the subdomain code under /t/ and have the webserver rewrite. Works great until you hit a no slash url with a slash (404 or a slash url with no slash (route becomes /t/sub/t/sub/wherever
(09:18:09 PM) cdunklau: mpc1000: that sounds like a completely unecessary hack
(09:18:14 PM) joshfinnie [~joshfinni@c-69-243-26-215.hsd1.md.comcast.net] entered the room.
(09:18:19 PM) cdunklau: mpc1000: why bother with rewrites when flask does it?
(09:18:35 PM) cdunklau: midnightcoffee: just use the model you've defined
(09:18:39 PM) soulseekah: mpc1000, yeh, just woke up
(09:18:42 PM) cdunklau: midnightcoffee: you have defined models, yes?
the answer was yes,yes im a dummy
# database
(06:28:43 PM) dampxf: can someone help me uderstand what a store is in the context of http://packages.python.org/Flask-OpenID/ ? My webapp runs locally but not in on heroku and i'm thinking the reason might be that i have my "store" as a tmp folder in my app and that won't work in production.
(06:29:46 PM) bubu2345 left the room (quit: Quit: Page closed).
(06:30:26 PM) lar1914 [lar1914@186.176.73.4] entered the room.
(06:31:45 PM) DasIch: midnightcoffee1: "You can alternatively implement your own store that uses the database or a no-sql server. For more information about that, consult the python-openid documentation."
(06:32:16 PM) DasIch: midnightcoffee1: second paragraph under how to use ;)
(06:33:22 PM) DasIch: midnightcoffee1: if you use a service like heroku you indeed probably don't have filesystem access
(06:33:50 PM) dampxf: Dasich, Yea, so i need to figure out implement a store that uses database access.
(06:33:57 PM) joes1 [~Adium@213.111.90.25] entered the room.
(06:34:15 PM) DasIch: midnightcoffee1: indeed
#flask social shows some sort of integration.
(02:07:17 PM) dvanduzer: midnightcoffee: http://packages.python.org/Flask-Social/ is a sample integration
(02:14:45 PM) rhumzouc [~rhumzouc@75-101-96-64.dsl.static.sonic.net] entered the room.
(02:14:57 PM) rhumzouc left the room (quit: Client Quit).
(02:15:20 PM) dampxf: dvanduzer, a sample integration using Flask-Social, do you suggest i use it instead of the Flask-OpenID extension?
(02:19:58 PM) dvanduzer: midnightcoffee: I believe it only integrates Flask-OAuth and not Flask-OpenID, but the principal of storing the tokens and integrating with Flask-Login (via Flask-Security) should be the same.
(02:20:06 PM) jasonsee [~JSON@va-67-76-165-3.dyn.embarqhsd.net] entered the room.
(02:21:14 PM) dampxf: dvanduzer, Yea at least its something. I'm a nervous when i google looking for a solution and all i get is my own stackoverflow question
(02:21:57 PM) jasonsee left the room.
(02:22:12 PM) skot left the room (quit: Quit: ZNC - http://znc.in).
(02:22:27 PM) skot [~skot@2002:ad03:cd62:0:211:32ff:fe14:8481] entered the room.
(02:22:30 PM) aviraldg left the room (quit: Read error: Connection reset by peer).
(02:22:31 PM) dvanduzer: midnightcoffee: Flask-Security (the meat of Flask-Social) will do most of that work for you
#OpenID security:
(10:29:55 PM) dampxf: Would it be secure to check the email i receive back from an OpenID provider against a list of trusted emails for means of assigning user roles on my site?
(10:30:53 PM) eevee: no
(10:31:09 PM) eevee: i could set up an openid provider that claims i have any arbitrary email
(10:34:28 PM) dampxf: eevee, errr maybe i'm confused. After the user is authenticated i'm able to get some information back. like nickname, email, etc... ur saying i can't trust this to be accurate? Like someone else could send my site a midnightcoffee@gmail.com even though thats my email?
(10:34:51 PM) xpen left the room (quit: Ping timeout: 276 seconds).
(10:34:54 PM) eevee: yes; the nickname and email and etc are totally arbitrary and at the site's discretion
(10:35:07 PM) eevee: the only thing you can trust is the url that gets verified
(10:35:17 PM) o11c: the only information openid is good for is unique identity validation
(10:35:29 PM) recurrence [~recurrenc@c-67-180-74-231.hsd1.ca.comcast.net] entered the room.
(10:35:31 PM) recurrence left the room (quit: Excess Flood).
(10:35:32 PM) Petskull: ok, peep this, g-dawgs (including mh`)! If I comment out the scrollbar, it expands all the way! --->>> http://image.bayimg.com/1caf1b93ff0f3beb1d85e07cc6967ce088d8653c.jpg
(10:35:45 PM) blf: Does it sound reasonable to allow the user of a class to assign the class a function to be called by the class during one of its routines?
(10:35:47 PM) eevee: feel free to *send* email to that address, but don't assume that the person actually owns it
(10:44:47 PM) dampxf: eevee, so how do i use the verified url? Where can i read about this without asking 50 more questions? my google is weak.
(10:44:54 PM) renstar left the room (quit: Read error: Connection reset by peer).
(10:45:20 PM) Buglouse [~Buglouse@unaffiliated/Buglouse] entered the room.
(10:45:21 PM) blf: netbat: the ones-complement of A is not(A). the twos-complement of A is not(A) + 1
(10:45:44 PM) bob2: midnightcoffee, it's a unique identifier that they have "proven" they owned at the time they gave it to you
(10:46:06 PM) nedbat: blf: i'm just not sure what you are displaying? Isn't it going to be displayed as -1234 either way? What are you building?
(10:46:07 PM) eevee: midnightcoffee: whatever library you're using should expose this stuff
(10:46:17 PM) bob2: midnightcoffee, (if you want to know their email address, email a long random string to the address they gave you then ask them to enter the long random string)
(11:04:26 PM) dash: midnightcoffee: persona sounds like a good fit if you want to identify users via email address
(11:04:32 PM) dash: midnightcoffee: since that's what it's built around
(11:04:48 PM) bob2: socentralised :/
(11:04:58 PM) dash: midnightcoffee: the way we use it on our site is to track user accounts by email address, and assign them different acls from there
Talk with dash about about BrowserID and sslify
(06:05:24 PM) dampxf: Hey dash, my app is working live but failing in production i get a "login error: failed" when i try click the broswerID button.... i have not stacktrace to go on and my heroku logs are don't show anything. any ideas?
(06:07:25 PM) dampxf: The only thing i could think of is that i have my site redirecting to https:// even on the login page. Maybe that interferes with it..
(01/08/2013 03:57:54 PM) dampxf: I posted my question on IT Security. http://security.stackexchange.com/questions/26709/browserid-and-https-conflictds... still not sure how to proceed. I had some elementary success just limiting the redirection a bit. But it seemed randomly the url would goto https then it was stuck there. I'm hopeing someone can at least confirm the login failure is because its https.
(03:59:35 PM) dash: hmm
(03:59:41 PM) dash: well we use browserid and https together just fine
(03:59:57 PM) dash: so i have to wonder what happened
(04:00:02 PM) dash: is your code somewhere i can look at it?
(06:04:06 PM) dampxf: err i have https://github.com/kennethreitz/flask-sslify imported and https://github.com/garbados/flask-browserid and here is my code https://github.com/Midnightcoffee/petal/tree/master/petalapp. I'll try to put that together in a better way.
(10:10:20 PM) dampxf: any ideas? I admit there is to much going on here for me to be sure where the point of failure is...
(01/09/2013 11:51:03 AM) dampxf: Let me know if i'm infringing on your good graces.... I looked deeper into the role that heroku and gunicorn play and concluded that https://github.com/kennethreitz/flask-sslify/blob/master/flask_sslify.py was appropriately forcing the user to speak with the heroku routing layer using https. I'm not sure it matters that gunicorn added ssl support in 17.0 (some time after the last flask-sslify commit). What throws me for a loop is my application https://github.com/Midnightcoffee/petal. worked fine before with just the https://github.com/garbados/flask-browserid and my accompanying code https://github.com/Midnightcoffee/petal/blob/master/petalapp/browserid_tools.py. But failed when i combined the two. My heroku logs shows nothing other then several attempts to connect to api/login. Which could indicate anything from what i read here: http://django-browserid.readthedocs.org/en/latest/details/troubleshooting.html
(11:51:35 AM) dash: hey. i don't mind you asking :)
(11:51:50 AM) dash: you got cut off at "throws me for a"
(11:52:09 AM) dampxf: What throws me for a loop is my application https://github.com/Midnightcoffee/petal. worked fine before with just the https://github.com/garbados/flask-browserid and my accompanying code https://github.com/Midnightcoffee/petal/blob/master/petalapp/browserid_tools.py. But failed when i combined the two. My heroku logs shows nothing other then several attempts to connect to api/login
(11:52:26 AM) dampxf: Which could indicate anything from what i read here: http://django-browserid.readthedocs.org/en/latest/details/troubleshooting.html
(04:01:31 PM) dampxf: sorry to keep asking... any ideas on what i should be investigating?
(04:04:50 PM) dash: i don't know very much about flask or heroku
(04:04:57 PM) dash: so i'm not sure how much I can help
(04:05:03 PM) dash: ummm
(04:06:05 PM) dampxf: thanks ok, i'll figure it out somehow :)
(04:06:06 PM) dash: where is it failing?
(04:06:21 PM) dash: goes get_user ever get called?
(04:06:23 PM) dash: er does
(04:07:03 PM) dampxf: when i click login comes back "login failed" only happens after i pip install flask-sslify
(04:16:45 PM) dampxf: get_user -> function defined https://github.com/Midnightcoffee/petal/blob/master/petalapp/browserid_tools.py#L7, becomes function of browserid class as user_loader-> https://github.com/Midnightcoffee/petal/blob/master/petalapp/__init__.py#L49, how extension uses it -> https://github.com/garbados/flask-browserid/blob/master/flaskext/browserid/__init__.py#L54. I hope that answers your question.
(04:30:46 PM) dash: what are you clicking? where do you seen 'login failed'?
(04:30:56 PM) dash: seeing the actual flow of http requests would help
(04:47:34 PM) dampxf: Here are my heroku logs:https://gist.github.com/4497247 I believe what your asking for is at the bottom as heroku[router]. I only see a get request to api/login which represents when i clicked the login button on my webapp.
(04:49:09 PM) dash: right. and what gets posted to /api/login?
(04:57:24 PM) dampxf: i believe the 'https://verifier.login.persona.org/very', and a ... the url_root? https://github.com/garbados/flask-browserid/blob/master/flaskext/browserid/__init__.py#L74.
(05:04:06 PM) dampxf: for what its worth i the app to sort-of work by expanding https://github.com/kennethreitz/flask-sslify/blob/master/flask_sslify.py#L47 -> to exclude urls that contained the words /login,/logout /favicon (some flask thing). as here https://github.com/Midnightcoffee/petal/blob/master/petalapp/flask_sslify.py but it didn't work whenever i used the back button in the browser and
(05:04:30 PM) dampxf: didn't feel like a good idea to jerry rig code i don't fully understand
(05:10:51 PM) dash: yeah i have no idea how the flask stuff works
(05:11:09 PM) dash: this seems like a flask-sslify question more than anything
(05:11:27 PM) dampxf: i emailed him /=
(05:11:33 PM) dampxf: thanks dash!
(05:12:02 PM) dampxf: you helped me narrow down the range which is huge.
(05:12:15 PM) dash: <3
Danjou reccomends having server do it
(06:05:24 PM) dampxf: Hey dash, my app is working live but failing in production i get a "login error: failed" when i try click the broswerID button.... i have not stacktrace to go on and my heroku logs are don't show anything. any ideas?
(06:07:25 PM) dampxf: The only thing i could think of is that i have my site redirecting to https:// even on the login page. Maybe that interferes with it..
(01/08/2013 03:57:54 PM) dampxf: I posted my question on IT Security. http://security.stackexchange.com/questions/26709/browserid-and-https-conflictds... still not sure how to proceed. I had some elementary success just limiting the redirection a bit. But it seemed randomly the url would goto https then it was stuck there. I'm hopeing someone can at least confirm the login failure is because its https.
(03:59:35 PM) dash: hmm
(03:59:41 PM) dash: well we use browserid and https together just fine
(03:59:57 PM) dash: so i have to wonder what happened
(04:00:02 PM) dash: is your code somewhere i can look at it?
(06:04:06 PM) dampxf: err i have https://github.com/kennethreitz/flask-sslify imported and https://github.com/garbados/flask-browserid and here is my code https://github.com/Midnightcoffee/petal/tree/master/petalapp. I'll try to put that together in a better way.
(10:10:20 PM) dampxf: any ideas? I admit there is to much going on here for me to be sure where the point of failure is...
(01/09/2013 11:51:03 AM) dampxf: Let me know if i'm infringing on your good graces.... I looked deeper into the role that heroku and gunicorn play and concluded that https://github.com/kennethreitz/flask-sslify/blob/master/flask_sslify.py was appropriately forcing the user to speak with the heroku routing layer using https. I'm not sure it matters that gunicorn added ssl support in 17.0 (some time after the last flask-sslify commit). What throws me for a loop is my application https://github.com/Midnightcoffee/petal. worked fine before with just the https://github.com/garbados/flask-browserid and my accompanying code https://github.com/Midnightcoffee/petal/blob/master/petalapp/browserid_tools.py. But failed when i combined the two. My heroku logs shows nothing other then several attempts to connect to api/login. Which could indicate anything from what i read here: http://django-browserid.readthedocs.org/en/latest/details/troubleshooting.html
(11:51:35 AM) dash: hey. i don't mind you asking :)
(11:51:50 AM) dash: you got cut off at "throws me for a"
(11:52:09 AM) dampxf: What throws me for a loop is my application https://github.com/Midnightcoffee/petal. worked fine before with just the https://github.com/garbados/flask-browserid and my accompanying code https://github.com/Midnightcoffee/petal/blob/master/petalapp/browserid_tools.py. But failed when i combined the two. My heroku logs shows nothing other then several attempts to connect to api/login
(11:52:26 AM) dampxf: Which could indicate anything from what i read here: http://django-browserid.readthedocs.org/en/latest/details/troubleshooting.html
(04:01:31 PM) dampxf: sorry to keep asking... any ideas on what i should be investigating?
(04:04:50 PM) dash: i don't know very much about flask or heroku
(04:04:57 PM) dash: so i'm not sure how much I can help
(04:05:03 PM) dash: ummm
(04:06:05 PM) dampxf: thanks ok, i'll figure it out somehow :)
(04:06:06 PM) dash: where is it failing?
(04:06:21 PM) dash: goes get_user ever get called?
(04:06:23 PM) dash: er does
(04:07:03 PM) dampxf: when i click login comes back "login failed" only happens after i pip install flask-sslify
(04:16:45 PM) dampxf: get_user -> function defined https://github.com/Midnightcoffee/petal/blob/master/petalapp/browserid_tools.py#L7, becomes function of browserid class as user_loader-> https://github.com/Midnightcoffee/petal/blob/master/petalapp/__init__.py#L49, how extension uses it -> https://github.com/garbados/flask-browserid/blob/master/flaskext/browserid/__init__.py#L54. I hope that answers your question.
(04:30:46 PM) dash: what are you clicking? where do you seen 'login failed'?
(04:30:56 PM) dash: seeing the actual flow of http requests would help
(04:47:34 PM) dampxf: Here are my heroku logs:https://gist.github.com/4497247 I believe what your asking for is at the bottom as heroku[router]. I only see a get request to api/login which represents when i clicked the login button on my webapp.
(04:49:09 PM) dash: right. and what gets posted to /api/login?
(04:57:24 PM) dampxf: i believe the 'https://verifier.login.persona.org/very', and a ... the url_root? https://github.com/garbados/flask-browserid/blob/master/flaskext/browserid/__init__.py#L74.
(05:04:06 PM) dampxf: for what its worth i the app to sort-of work by expanding https://github.com/kennethreitz/flask-sslify/blob/master/flask_sslify.py#L47 -> to exclude urls that contained the words /login,/logout /favicon (some flask thing). as here https://github.com/Midnightcoffee/petal/blob/master/petalapp/flask_sslify.py but it didn't work whenever i used the back button in the browser and
(05:04:30 PM) dampxf: didn't feel like a good idea to jerry rig code i don't fully understand
(05:10:51 PM) dash: yeah i have no idea how the flask stuff works
(05:11:09 PM) dash: this seems like a flask-sslify question more than anything
(05:11:27 PM) dampxf: i emailed him /=
(05:11:33 PM) dampxf: thanks dash!
(05:12:02 PM) dampxf: you helped me narrow down the range which is huge.
(05:12:15 PM) dash: <3
Asking on Heroku about ssl issue
(08:45:27 PM) dampxf: i'm searching and i cannot seem to find much about how to specify a port on heroku. My inquiry is due to the answer to my question here http://security.stackexchange.com/questions/26709/browserid-and-https-conflict/26727#26727, in case someone can quickly tell me i'm looking in the wrong direction.
(08:46:12 PM) jasonh: /5/5
(08:46:13 PM) jasonh: err.
(08:46:39 PM) fellu left the room (quit: Ping timeout: 260 seconds).
(08:48:05 PM) dampxf: it seems heroku handles ports for me, probable not a good idea to temper with that. Its probable also not a solution to my problem just a way to test it
(08:48:11 PM) thehoff [~ahoff@unaffiliated/thehoff] entered the room.
(08:48:53 PM) fellu [fellu@skyred.fi] entered the room.
(08:53:15 PM) thehoff left the room (quit: Quit: WeeChat 0.3.9.2).
(08:54:07 PM) thehoff [~ahoff@unaffiliated/thehoff] entered the room.
(08:59:39 PM) pvh___ left the room (quit: Quit: Connection closed for inactivity).
(09:00:05 PM) thehoff left the room (quit: Quit: WeeChat 0.3.9.2).
(09:00:38 PM) maletor left the room (quit: Quit: Computer has gone to sleep.).
(09:02:47 PM) carllerche left the room (quit: Quit: carllerche).
(09:04:38 PM) blakmatrix left the room (quit: Remote host closed the connection).
(09:06:28 PM) thehoff [~ahoff@unaffiliated/thehoff] entered the room.
(09:06:43 PM) pencilcheck left the room (quit: Remote host closed the connection).
(09:09:34 PM) cloudy_j left the room (quit: Remote host closed the connection).
(09:13:27 PM) kr left the room (quit: Remote host closed the connection).
(09:14:58 PM) brjavaman left the room (quit: Quit: Leaving.).
(09:15:17 PM) ojii|afk is now known as ojii
(09:16:49 PM) kr [~kr@204.14.152.118] entered the room.
(09:16:58 PM) fermion left the room (quit: Ping timeout: 246 seconds).
(09:24:36 PM) kr left the room (quit: Remote host closed the connection).
(09:25:26 PM) yfeldblum: midnightcoffee, your application is required, on startup, to look at the PORT environment variable (or you can do this in the Procfile command and pass it in as a parameter to the app); and it is required, within 60 seconds of being started, to start listening on that port (i assume on all interfaces, which is the default)
(09:27:26 PM) cloudy_j [~cloudy_j@c-98-217-193-206.hsd1.ma.comcast.net] entered the room.
(09:30:52 PM) yfeldblum left the room (quit: Ping timeout: 256 seconds).
(09:32:33 PM) rburton- [~rburton-@c-67-180-209-222.hsd1.ca.comcast.net] entered the room.
(09:45:10 PM) rburton- left the room (quit: Quit: Leaving...).
(09:46:01 PM) yfeldblum [~jay@c-71-206-30-119.hsd1.md.comcast.net] entered the room.
(09:53:57 PM) oisinh_ left the room (quit: Quit: Connection closed for inactivity).
(09:55:04 PM) kr [~kr@204.14.152.118] entered the room.
(09:59:53 PM) pydanny [~textual@cpe-76-174-54-73.socal.res.rr.com] entered the room.
(10:05:38 PM) kr left the room (quit: Ping timeout: 255 seconds).
(10:15:04 PM) cheeby [~cheeby@pdpc/supporter/professional/cheeby] entered the room.
(10:21:16 PM) DatumDrop left the room (quit: Remote host closed the connection).
(10:21:45 PM) rburton- [~rburton-@c-67-180-209-222.hsd1.ca.comcast.net] entered the room.
(10:23:53 PM) dmclain left the room (quit: Quit: Computer has gone to sleep.).
(10:24:25 PM) GarethAdams left the room (quit: Quit: Leaving...).
(10:24:36 PM) maletor [~maletor@c-69-181-33-169.hsd1.ca.comcast.net] entered the room.
(10:30:45 PM) ojii is now known as ojii|afk
(10:31:52 PM) kr [~kr@204.14.152.118] entered the room.
(10:42:13 PM) kr left the room (quit: Ping timeout: 248 seconds).
(10:45:49 PM) dmclain [~textual@75-43-17-191.lightspeed.austtx.sbcglobal.net] entered the room.
(10:53:52 PM) maletor left the room (quit: Quit: Computer has gone to sleep.).
(10:58:34 PM) dampxf: so... heroku config:add PORT=443? should make my device listen only on port 443? sorry im new and their doesn't seem to much information on this which leads me to believe im looking the wrong direction
(10:58:48 PM) yoonchee [~chyoon@222.106.196.129] entered the room.
(10:59:07 PM) dampxf: yfeldblum: so... heroku config:add PORT=443? should make my device listen only on port 443? sorry im new and their doesn't seem to much information on this which leads me to believe im looking the wrong direction.
(11:00:41 PM) yfeldblum: midnightcoffee, no, you must not use the PORT config var
(11:01:11 PM) yfeldblum: midnightcoffee, heroku will come up with a port on its own and tell you what it is, through the environment variable PORT that your Procfile or application must look for
(11:01:26 PM) yfeldblum: midnightcoffee, the PORT that heroku gives you will not be 443
(11:02:22 PM) yfeldblum: midnightcoffee, also keep in mind that heroku has a routing layer through which HTTP requests pass; so the PORT that heroku gives you is *not* the port that users will use when trying to talk to your application
(11:02:54 PM) yfeldblum: midnightcoffee, users will use ports 80 (HTTP) and 443 (HTTPS), and heroku will pass the requests through to your application on the PORT that it told your application to listen to
(11:03:51 PM) dampxf: yfeldbluf: right, makes sense thanks for the information.
(11:04:58 PM) The account has disconnected and you are no longer in this chat. You will be automatically rejoined in the chat when the account reconnects.
(01/09/2013 09:10:09 AM) The topic for #heroku is: Docs at https://devcenter.heroku.com || Current status at https://status.heroku.com || Support at https://support.heroku.com
(09:16:07 AM) ojii is now known as ojii|afk
(09:20:11 AM) suy left the room ("http://quassel-irc.org - Chat comfortably. Anywhere.").
(09:23:09 AM) lvh [~lvh@python/psf/lvh] entered the room.
(09:27:37 AM) sbeam_ [~sbeam@23-25-200-205-static.hfc.comcastbusiness.net] entered the room.
(09:30:34 AM) fermion left the room (quit: Read error: Connection reset by peer).
(09:32:06 AM) bed777 [~bed777@host142-252-static.226-95-b.business.telecomitalia.it] entered the room.
(09:35:40 AM) chuckharmston [~chuckharm@mobile-198-228-233-048.mycingular.net] entered the room.
(09:37:05 AM) chuckharmston left the room (quit: Client Quit).
(09:37:16 AM) alexis is now known as ametaireau
(09:46:14 AM) Takehiro left the room (quit: Remote host closed the connection).
(09:48:57 AM) dampxf: yfedldblum, it says here https://devcenter.heroku.com/articles/ssl-endpoint that ssl is enabled by default. Does this mean the connection is HTTPS ... even if in my browser isn't reflecting that?
(09:49:59 AM) Guest25886 [~Jackneill@195-38-98-32.pool.digikabel.hu] entered the room.
(09:56:50 AM) brjavaman [~brjavaman@189-69-75-147.dsl.telesp.net.br] entered the room.
(10:00:04 AM) moradan [c3a0e917@gateway/web/freenode/ip.195.160.233.23] entered the room.
(10:01:32 AM) moradan: hello, something strange - I'm trying to push to heroku and I'm rejected with "Permission denied (publickey)." but "heroku keys" shows my current key - and I tried to remove it and add again with no success. Can anyone help?
(10:02:14 AM) jdag [~jdag@24.130.35.148] entered the room.
(10:05:44 AM) catsby: midnightcoffee: ssl is enabled if you use myapp.herokuapp.com
(10:06:04 AM) yfeldblum: midnightcoffee, yes, if the user browses using "https://"; otherwise, it's enabled but the user didn't elect to use it
(10:06:05 AM) catsby: If you want ssl on a custom domain www.myapp.com you need to get a cert etc.
(10:06:49 AM) yfeldblum: midnightcoffee, if it's a rails application, you can put `config.force_ssl = true` into your `config/environments/production.rb` to force users to browse your site over SSL
(10:07:56 AM) nateberkopec [~nateberko@207.239.107.3] entered the room.
(10:08:54 AM) dampxf: catsby: thanks, not sure i need a custom domain.
(10:08:58 AM) lvh left the room (quit: Read error: Connection reset by peer).
(10:09:17 AM) lvh [~lvh@python/psf/lvh] entered the room.
(10:10:16 AM) yfeldblum: midnightcoffee, otherwise, your application will be available over both HTTP and HTTPS, and the protocol that will be used is whichever the user selects (probably HTTP by default)
(10:11:55 AM) digitalsanctum [~digitalsa@208.96.180.11] entered the room.
(10:14:24 AM) brjavaman left the room (quit: Quit: Leaving.).
(10:14:57 AM) dampxf: yfeldblum, im fairly confused. I was advised on /pocoo (flask). that "my websever" (gunicorn, which just added ssl support in 17.0) should be handling handling the https. When i search online everyone is using "middleware" i believe (https://github.com/kennethreitz/flask-sslify) is an example. I'm i missing the larger picture or are there simple many possible routes?
(10:15:22 AM) dampxf: yfeldblum, and thanks a lot
(10:15:49 AM) yfeldblum: midnightcoffee, if you want SSL on Heroku, then *heroku* handles SSL, not your application
(10:16:38 AM) Takehiro [~Takehiro@p14060-ipngn100201kyoto.kyoto.ocn.ne.jp] entered the room.
(10:17:02 AM) yfeldblum: midnightcoffee, your application must simply talk regular HTTP, not HTTPS; the user will maintain an HTTPS connection to the heroku routing layer, and then the heroku routing layer will terminate the SSL and pass on HTTP requests to your application
(10:17:35 AM) seanbrant [~seanbrant@c-98-228-68-134.hsd1.in.comcast.net] entered the room.
(10:17:36 AM) yfeldblum: midnightcoffee, http://en.wikipedia.org/wiki/SSL_termination_proxy
(10:18:30 AM) yfeldblum: midnightcoffee, users do *not* talk to your application directly; they talk to the heroku routing layer, which stands in the middle between your users and your application, directing traffic and performing other useful services
(10:21:15 AM) Takehiro left the room (quit: Ping timeout: 240 seconds).
(10:22:46 AM) yfeldblum: midnightcoffee, that make any sense?
(10:23:31 AM) wingy left the room.
(10:25:04 AM) dampxf: yfeldblum, i think so. Do i need to force the user to use https when communicating with heroku routing layer?
(10:25:48 AM) lvh: What is the appropriate shebang line to use for a python script inside heroku?
(10:25:52 AM) lvh: #!python didn't work: bash: bin/make_owner.py: python: bad interpreter: No such file or directory
(10:26:21 AM) fermion [~fermion@173-166-12-37-newengland.hfc.comcastbusiness.net] entered the room.
(10:28:02 AM) catsby: midnightcoffee: config.force_ssl = true is a good idea
(10:29:02 AM) dampxf: catsby, is that for rails? I'm using the flask microframework.
(10:29:13 AM) catsby: midnightcoffee: yeah sorry, thought you were using rails
(10:29:16 AM) CarlFK [~carl@c-98-223-151-105.hsd1.in.comcast.net] entered the room.
(10:30:05 AM) CarlFK: http://beta.flourishconf.com/ FATAL: remaining connection slots are reserved for non-replication superuser connections
(10:30:13 AM) CarlFK: error comes and goes..
(10:30:34 AM) yfeldblum: midnightcoffee, you can look at the "X-Forwarded-For", "X-Forwarded-Port", and "X-Forwarded-Proto" headers to check whether the user send an HTTP or HTTPS connection; heroku sets the "X-Forwarded-*" headers in the request it sends to your app based on the original HTTP request send by the user that Heroku received
(10:33:49 AM) dmclain [~textual@75-43-17-191.lightspeed.austtx.sbcglobal.net] entered the room.
(10:39:10 AM) yfeldblum: midnightcoffee, although your webserver library or application framework should hopefully have some API for exposing these headers and telling whether the request is over SSL directly or is proxied with an SSL terminating proxy
(10:40:48 AM) zrail|afk is now known as zrail
(10:50:17 AM) sokr left the room (quit: Quit: Page closed).
(10:50:49 AM) ametaireau is now known as alexis
(10:50:54 AM) dampxf: yfeldblum, thanks based on what i see in the extension i have linked thats exactly what its doing. But know i understand way more about how everything is working and why.
(02:41:05 AM) dampxf: could http://bpaste.net/show/QDvRvLTA6i6x5FFcRDDw/ be the result of a import loop or something?
(02:41:36 AM) Reite left the room (quit: Read error: Operation timed out).
(02:42:41 AM) elemoine [~elemoine@c2cpc3.camptocamp.com] entered the room.
(02:52:45 AM) ejo: midnightcoffee1: kind of two different things
(02:53:15 AM) ejo: what you pasted is a pretty ordinary situation in relational databases when you try to drop something that depends on something else
(02:53:19 AM) foodoo left the room (quit: Quit: leaving).
(02:54:08 AM) ejo: it's telling you what you need to do instead -- though there's the other approach that the error didn't bother to mention, which is that you can drop the dependent objects yourself rather than use a cascaded drop
(02:54:11 AM) dampxf: ejo: If i run that database in a small isolated without the rest of my code i can drop it just fine it seems.
(02:54:52 AM) dampxf: ejo: though i suppose i didn't load the db with any rows in that case....
(02:55:31 AM) dampxf: ejo: also adding to my stress level is the fact i tried cascading it (as far as my naive understanding goes) and it didn't seem to care.
(02:56:02 AM) jhauser [~jhauser@p549C5D7A.dip.t-dialin.net] entered the room.
(02:56:48 AM) ejo: what db is this on
(02:57:22 AM) ejo: midnightcoffee1: i may have more insight if it's postgresql, less if others
(02:57:43 AM) dampxf: ejo: it is postgresql
(02:58:04 AM) ejo: by any chance did you perform the drop(s) through pgadmin3 and its GUI?
(02:58:29 AM) ejo: because pgadmin3 has always had a bug where it does not apply cascaded drops correctly
(02:58:42 AM) ejo: and then you find they work properly from psql
(02:58:46 AM) dampxf: ejo: i'm using flask-sqlalchemy so drop_all
(02:59:07 AM) ejo: drop_all doesn't issue actual "DROP CASCADED" statements, does it?
(02:59:55 AM) ejo: I might have to ask for more context too: what is the overall thing you're trying to accomplish... is this in the context of dropping all your tables to reinitialize your database, or some other operation like that, or different
(03:00:42 AM) kwatch [~kwatch@s190.GtokyoFL26.vectant.ne.jp] entered the room.
(03:02:26 AM) dampxf: ejo: just to make sure i have a fresh start. I could just restart the table (whip it clean). its comforting to know i have a clean slate every time. here is my schema, apologies for the crappy additional tables i had to draw them with a mouse on a labtop http://postimage.org/image/zfevuw9az/
(03:03:27 AM) dampxf: whip it clean...= restart it. sense im using the heroku postgres https://devcenter.heroku.com/articles/heroku-postgresql
(03:03:46 AM) kwatch: [Q] How to submit 'select count(*) from users'?
(03:03:52 AM) kwatch: I tried 'dbsess.query(User).count()' and 'dbsess.query(User.id).count()' but both generate sql which contains subquery, such as 'select count(*) from (select users.id from users)'.
(03:04:30 AM) ejo: midnightcoffee1: this might be useful, or at least give you ideas that could help http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DropEverything
(03:05:30 AM) elemoine left the room (quit: Ping timeout: 264 seconds).
(03:06:54 AM) guysoft42 [~guysoft@46.19.81.104] entered the room.
(03:12:35 AM) elemoine [~elemoine@c2cpc3.camptocamp.com] entered the room.
(03:14:01 AM) dampxf: ejo: should i be cascading though? like on-delete and cascade=all?
(03:14:36 AM) ejo: midnightcoffee1: that is different from cascading drop-table or drop-constraint statements.
(03:14:41 AM) ejo: separate issues.
(03:15:41 AM) ejo: I am guessing that you are dropping entire tables rather than just their contents (rows). Your original question and paste didn't contain much information.
(03:19:11 AM) Ergo^ [~ergo@hyp-p-107.pabianice.msk.pl] entered the room.
(03:20:15 AM) guntha left the room ("WeeChat 0.3.8").
(03:25:50 AM) guysoft42 left the room (quit: Ping timeout: 260 seconds).
(03:30:17 AM) dampxf: ejo: yea, in my design the many-to-manys can have orphans. i don't want the the children to be deleted if the parents are... so in that context does a cascade even make sense?
(03:30:41 AM) ejo: still talking about two different kinds of cascade. two separate things.
(03:31:00 AM) ejo: the error message was about the need for cascaded DROP TABLE or DROP CONSTRAINT statements.
(03:31:28 AM) ejo: those are a different sort of thing from (a) cascaded foreign keys or (b) sqlalchemy relationship cascades.
(03:32:06 AM) dampxf: ejo: oh, yes. ok i see what you mean. my previous statement was about (a) but im really glad you highlighted the idea there seperate things.
(03:32:24 AM) dampxf: ejo: that there*
(03:33:17 AM) ejo: midnightcoffee1: http://www.postgresql.org/docs/9.2/static/ddl-depend.html
(03:34:57 AM) dampxf: ejo: is http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DropEverything the sqlalchemy way of doing http://www.postgresql.org/docs/9.2/static/ddl-depend.html? or should i just use the (i haven't done this..) postgres shell to issue that command?
(03:35:18 AM) dampxf: ejo: also thanks a lot.
(03:35:58 AM) ejo: And to answer your question about foreign keys: yes, if you want to allow orphan rows, i.e. you do not want them to be automatically deleted when the (parent) rows they refer to are deleted, then that's correct, you would not want those foreign keys set to "ON DELETE CASCADE".
(03:36:53 AM) ejo: midnightcoffee1: depends on your style and preference... some like to do that stuff from a command line, others prefer to have a script. Kind of depends on whether it's an action you frequently repeat too (convenience)
(03:38:06 AM) Shyde [~Shyde^^@HSI-KBW-078-043-093-037.hsi4.kabel-badenwuerttemberg.de] entered the room.
(03:38:44 AM) dampxf: ejo: k great! your explanations were amazing. i can't thank you enough. im going to bed before i get sick.
(02:58:05 PM) dampxf: I'm trying to figure out a way to prevent the user from accessing a certain url unless they have submitted information on a previous page. Its unlikely someone would do this as it requires them to input the url but i want to be sure. I think this can be achieved with a try except: http://bpaste.net/show/78150/ but maybe i should look into making it work with flask-principle? http://pythonhosted.org/Flask-Principal/
(03:00:21 PM) mattupstate: midnightcoffee: principal wont really help you there
(03:00:58 PM) mattupstate: its not a permission you're setting up
(03:01:06 PM) mattupstate: you're just managing the state of a session
(03:02:17 PM) dampxf: mattupstate: The use of try except indicates to me that i might be doing this wrong, i'm fishing for more appropriate solutions.
(03:02:19 PM) XenGi_ is now known as XenGi
(03:02:38 PM) mattupstate: why do you think try/except is wrong?
(03:02:39 PM) stranac left the room (quit: Read error: Connection reset by peer).
(03:02:59 PM) mattupstate: if you don't want to use try except you could do
ejo - sqlalchemy
Doobeh, arg)s, dAnjou
Jump to Line
Something went wrong with that request. Please try again.