[pylons-discuss] Using Pyramid with an AngularJS app

2013-10-09 Thread Mark Huang
Hi, I've used Pyramid for my last project and I loved it, however, now it's my first time using it purely for creating the API and allowing my AngularJS client app to interact with it. I want to know for my use-case, whether I need to alter any of the authentication policies or session

Re: has anyone replaced the default json renderer with a custom one ?

2013-02-19 Thread Mark Huang
Could you post the JSON renderer to deal with datetimes as well? I've had some problems in the past and I used a hack instead of a custom JSON renderer because I didn't know how to write one. A blog post or something would be useful too. On Tuesday, 19 February 2013 19:27:36 UTC-6, Jonathan

Re: Perform some action before pserve

2012-10-25 Thread Mark Huang
Thanks for your answer. I agree with you. For staging/production, fabric is the way to go, even though I haven't taken time to learn it properly yet. For development, our team is really young and new to Python, linux for that matter. I'm in China, everyone uses Windows here. I wanted

Re: Perform some action before pserve

2012-10-25 Thread Mark Huang
of virtualenvwrapper. Thanks everyone! On Wednesday, 24 October 2012 10:01:55 UTC-5, Mark Huang wrote: Hi, I want to set some environment variables on my Ubuntu machine before I run pserve command. Reason that it's not set in the ini file is because a particular python file in my Pyramid

Perform some action before pserve

2012-10-24 Thread Mark Huang
. Regards, Mark Huang -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/_7kroRdiFdQJ. To post to this group, send email to pylons-discuss@googlegroups.com

Re: ./run No such file or directory

2012-10-07 Thread Mark Huang
Then in my run script I have: #!/bin/bash gunicorn_paster --config=path_to_config.py_file /srv/web/prod/test/production.ini I'm pretty sure this will be similar when used under Heroku. I hope this helps your use case. Regards, Mark Huang On Monday, 1 October 2012 01:41:32 UTC+8, Zak wrote

Deform for CouchDB-like databases

2012-10-07 Thread Mark Huang
. Would deform work for CouchDB? Are there any packages that do something similar like deform for Pyramid using CouchDB? Regards, Mark Huang -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To view this discussion on the web visit https

Re: Deform for CouchDB-like databases

2012-10-07 Thread Mark Huang
Oh? Thanks for the enlightenment. It's just that the examples always mention the words relational database, so I always had the misconception of it being dependent on a RDBMS. On Sunday, 7 October 2012 17:33:19 UTC+8, Chris McDonough wrote: On Sun, 2012-10-07 at 01:56 -0700, Mark Huang wrote

Re: Deform for CouchDB-like databases

2012-10-07 Thread Mark Huang
to save the data, but I would be unable to make use of the beaker session object, say for showing flash messages. Advise needed. Thanks in advance! On Sunday, 7 October 2012 17:33:19 UTC+8, Chris McDonough wrote: On Sun, 2012-10-07 at 01:56 -0700, Mark Huang wrote: Hi, I have

Gunicron running.py file HOW-TO

2012-08-19 Thread Mark Huang
Hi, I was reading the Pyramid cookbook and found the Heroku deployment guide. There's a section inside that talks about creating a file called running.py: import os from paste.deploy import loadappfrom waitress import serve if __name__ == __main__: port = int(os.environ.get(PORT, 5000))

Re: Gunicron running.py file HOW-TO

2012-08-19 Thread Mark Huang
://gunicorn.org/run.html#contents Once you install gunicorn a *gunicorn_paster* command is available. This command makes your Pyramid (Paster-like) application run. I use it with nginx and supervisor Hope it helps León On Sunday, 19 August 2012 19:30:43 UTC+2, Mark Huang wrote: Hi, I

Re: Running Pyramid with Gunicorn as non root user

2012-07-08 Thread Mark Huang
Gunicorn in the setup.py of my pyramid app. So after entering the virtualenv using virtualenvwrapper: workon my_env I do a python setup.py develop. Won't this add gunicorn to my virtual environment? On Wednesday, 4 July 2012 22:32:05 UTC-5, Mark Huang wrote: Hi Everyone, I

Beaker sessions removing browser cookie

2012-07-05 Thread Mark Huang
Hi all, I'm using beaker sessions in my pyramid application. I am using session.type = file. I currently have a problem: When the user hits the login page, he is able to login. However, if he logs out (loggin out will bring him back to the login page) and doesn't close the browser window,

Running Pyramid with Gunicorn as non root user

2012-07-04 Thread Mark Huang
!! What's going on? I suspect it is permissions related or something and that I am unable to run Gunicorn as a non root user (without shell access). Regards, Mark Huang -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To view this discussion

Re: Running Pyramid with Gunicorn as non root user

2012-07-04 Thread Mark Huang
I'd like to add on to this: If I were to run the command without the -u flag, my pyramid application will get started with no problems at all, just that it will be running as the root user. On Wednesday, 4 July 2012 22:32:05 UTC-5, Mark Huang wrote: Hi Everyone, I currently have 2 servers

Re: How would I do cross domain with Pyramid and Nginx

2012-07-03 Thread Mark Huang
explanation. Yes, I do intend to use RabbitMQ eventually once the load starts to increase, but for now, a curl is all I need. I was just over-complicating things. Regards, Mark Huang On Sunday, 17 June 2012 17:36:57 UTC-5, Andi Balke wrote: but thinking again about that: why don't you

Re: How would I do cross domain with Pyramid and Nginx

2012-06-17 Thread Mark Huang
Just wanted to confirm one thing before this is closed. How do I transfer the data that I processed via the response? Is it using the response.body to add the data in there? On Thursday, 14 June 2012 14:04:58 UTC-5, Mark Huang wrote: Thanks Michael for your response once again (here

Fine grained/Object-level security example

2012-06-16 Thread Mark Huang
Hi, I am developing an ERP application and the authorization requirements are crazy complicated. I'm pretty sure I need object-level security as stated in the Auth tutorialhttp://michael.merickel.org/projects/pyramid_auth_demo/object_security.htmlof Pyramid by Michael Merickel. The problem

Re: Running pserve as another user causes import error

2012-06-14 Thread Mark Huang
Thanks everyone. I finally decided to re-do my setup and it worked. On Wednesday, 13 June 2012 16:04:35 UTC-5, Mike Orr wrote: On Wed, Jun 13, 2012 at 10:36 AM, Mark Huang zhengha...@gmail.com wrote: Hi all, I recently transferred all my code to a production server and was trying

How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Mark Huang
) { proxy_pass http://rhino.abc.com; } } location ^~ /pdf/ { #rewrite ^/pdf/(.*) /pdf/$1 break; --What do I do here? *proxy_pass http://mantis.abc.com/;* } } Can someone please help me out? Regards, Mark Huang -- You received this message

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Mark Huang
I figured out the way to configure the nginx, so that part is done. My question still remains. Is it possible to forward some data cross-domain and receive soemthing back in response? I noticed the Response object has a body attribute. Is this used to pass data? Regards, Mark Huang

Re: Pyramid authentication - how to check effective principals in view code

2012-06-14 Thread Mark Huang
Hmmyou bring up a good point. I'd be interested in the responses stated here. On Thursday, 14 June 2012 06:47:38 UTC-5, Przemyslaw wrote: Hi! What I need is a possibility to get the list of logged-in user's principals in my view (so I can e.g. disable 'Edit' link for users not

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Mark Huang
the Response object? Regards, Mark Huang On Thursday, 14 June 2012 14:58:26 UTC+8, Mark Huang wrote: Hi, I'm not sure if this question belongs here because it touches Pyramid as well as Nginx. I have two web applications, one called rhino another called mantis ( rhino.abc.com mantis.abc.com

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Mark Huang
. Andi, could you illustrate what your setup was on Pyramid to do this X-Accel thingy? On Thursday, 14 June 2012 14:58:26 UTC+8, Mark Huang wrote: Hi, I'm not sure if this question belongs here because it touches Pyramid as well as Nginx. I have two web applications, one called rhino

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Mark Huang
the contents of the Response from A as req.body. Did I get this part right? I'm sorry for being such a noob. On Friday, 15 June 2012 00:51:41 UTC+8, Michael Merickel wrote: On Thu, Jun 14, 2012 at 11:36 AM, Mark Huang zhengha...@gmail.com wrote: Andi, could you illustrate what your setup

Re: Minimatic for Pyramid?

2012-06-13 Thread Mark Huang
] return a list? Regards, Mark Huang -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/9FCDByA7onsJ. To post to this group, send email to pylons-discuss

Re: Minimatic for Pyramid?

2012-06-13 Thread Mark Huang
specify that I need to use it in every single vie/controller ( I come from a pylons world ) that I write? Regards Mark Huang -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To view this discussion on the web visit https://groups.google.com/d

Running pserve as another user causes import error

2012-06-13 Thread Mark Huang
created by the root user. However if I just run pserve production.ini start, I get no such errors. Can anybody help me? Regards, Mark Huang -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To view this discussion on the web visit https

Re: Pyramid for Pylons Users guide finished

2012-06-13 Thread Mark Huang
This is awesome! I wish this was available when I was learning authentication for pyramids. In the original documentation it wasn't very clear that making a call to remember would trigger the group finder callback function. This doc is very good and I highly recommend reading this over the

Re: Minimatic for Pyramid?

2012-06-13 Thread Mark Huang
Thanks Randall. Your explanation really helped! On Tuesday, 12 June 2012 14:31:05 UTC+8, Mark Huang wrote: Hi Pyramid experts, I am about to launch a web application soon and I realized I had some problems with js and css assets (minimizing and which one to use for production

Minimatic for Pyramid?

2012-06-12 Thread Mark Huang
is not supported in Pyramid and hence, Minimatic, being an extension of webhelpers, doesn't seem to work on Pyramid. What do you guys use for this sort of job. The key feature I need is for Pyramid to switch resources when I switch from development to production and vice versa. Regards, Mark Huang