Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Using Pyramid with Nginx and uWSGI
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jonah Dahlquist  
View profile  
 More options Jul 28 2012, 11:08 pm
From: Jonah Dahlquist <jonahbro...@gmail.com>
Date: Sat, 28 Jul 2012 20:08:15 -0700 (PDT)
Local: Sat, Jul 28 2012 11:08 pm
Subject: Using Pyramid with Nginx and uWSGI

Hello, world!

I'm coming into the Python world from a PHP background.  I'm trying to get
a working Pyramid application working on my own machine, and I've almost
made it.  I have nginx and uWSGI running, and can call a Python script from
the browser successfully.  However, lots of research, reading
documentation, and even reading through the "starter project" code has
failed to make it clear to me how to connect Pyramid to wsgi.  The script
looks like this:

def application(env, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])
    return "Hello universe!"

The INI configuration file for uWSGI is as follows:

[uwsgi]
socket = /tmp/uwsgi.sock
master = true
processes = 4
file = ./app.py
callable = application
daemonize = ./uwsgi.log
pidfile = /tmp/app_process.pid
virtualenv = /home/jonah/.virtualenvs/test

So a request to http://localhost/ in the browser gives me "Hello
Universe!".  How can I modify my script/uWSGI configuration to run Pyramid
instead?  Thanks for your help.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Craig Younkins  
View profile  
 More options Jul 29 2012, 12:47 am
From: Craig Younkins <cyounk...@gmail.com>
Date: Sun, 29 Jul 2012 00:47:22 -0400
Local: Sun, Jul 29 2012 12:47 am
Subject: Re: Using Pyramid with Nginx and uWSGI

You'll want to follow this tutorial to create your first Pyramid project -
http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/pro...

When you want to deploy it using uwsgi, follow up to step 7 in this
tutorial -
http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/tutorial...

In your uwsgi ini, 'file' will refer to 'pyramid.wsgi' in the tutorial
above, since it will have the wsgi application (callable = 'application')

Hope that helps!

Craig Younkins

On Sat, Jul 28, 2012 at 11:08 PM, Jonah Dahlquist <jonahbro...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Yarde  
View profile  
 More options Jul 30 2012, 5:07 am
From: Simon Yarde <simonya...@me.com>
Date: Mon, 30 Jul 2012 10:07:44 +0100
Local: Mon, Jul 30 2012 5:07 am
Subject: Re: Using Pyramid with Nginx and uWSGI
When you have a working pyramid starter project, this might be helpful...

http://projects.unbit.it/uwsgi/wiki/INIFiles

And this..

http://pythonpaste.org/deploy/

You can init like this;

    $ uwsgi development.ini

provided you have this line in your .ini

     [uwsgi]
     paste = config:<absolute_project_path>/development.ini

Alternatively, you can combine the ``ini`` and ``paste`` config action, and remove the need to reference your .ini file twice.

    $ uwsgi --ini-paste development.ini

The features above support having combined .ini files, or a single .ini files that configures multiple apps.

ps. You don't need that ``callable`` line because uwsgi reads your paste .ini file and derives from ``use = egg:MyProject``, which is short-hand for ``egg:MyProject#main`` - ``main`` being the callable in your project's ``__init__.py``. I write mine in full as I prefer to have as little implied config as possible.

On 29 Jul 2012, at 05:47, Craig Younkins wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonah Dahlquist  
View profile  
 More options Aug 13 2012, 4:31 pm
From: Jonah Dahlquist <jonahbro...@gmail.com>
Date: Mon, 13 Aug 2012 13:31:01 -0700 (PDT)
Local: Mon, Aug 13 2012 4:31 pm
Subject: Re: Using Pyramid with Nginx and uWSGI

Ahh, that first tutorial is great, I wish I had it at the beginning, I
would have been up to speed much quicker :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonah Dahlquist  
View profile  
 More options Aug 13 2012, 4:32 pm
From: Jonah Dahlquist <jonahbro...@gmail.com>
Date: Mon, 13 Aug 2012 13:32:32 -0700 (PDT)
Local: Mon, Aug 13 2012 4:32 pm
Subject: Re: Using Pyramid with Nginx and uWSGI

Sweet, Simon, that's exactly what I need.  Thanks so much, I'm quite
enjoying Python so far, and I have a working starter project now.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Vanasco  
View profile  
 More options Aug 13 2012, 7:48 pm
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Mon, 13 Aug 2012 16:48:41 -0700 (PDT)
Local: Mon, Aug 13 2012 7:48 pm
Subject: Re: Using Pyramid with Nginx and uWSGI
check out my last post in this thread:

http://groups.google.com/group/pylons-discuss/browse_thread/thread/2d...

might help you get going a bit faster


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »