This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

pyramid_upwork allows your users to authorize via upwork on your pyramid project.

You can find it on pypi as pyramid_upwork. Also don’t forget to check the documentation.


pyramid-redis-sessions is used to store session in Redis database, so you need to install Redis and configure it to listen to port

Other packages are installed automatically:


To activate jinja2 renderer, install:

pip install pyramid_jinja2


Install with pip:

pip install pyramid_upwork

or using easy_install:

easy_install pyramid_upwork

You need to create Upwork API keys of the type Web and set appropriate permissions to the generated API key.


You can take a look at the pyramid_upwork_example application or use the instructions below.

Include following settings in your *.ini file:



# Redis session settings
redis.sessions.secret = FILL ME

# upwork settings
upwork.api.key = FILL ME
upwork.api.secret = FILL ME

Then in your project’s define the following function:

def get_acl_group(user_uid, request):
    """Here goes your ACL logic."""
    # All authenticated users have ``view`` permission
    return 'view'

This function should return list of ACL group principals or None if user is not allowed to have any access groups. See pyramid documentation for security and tutorial.

Define a RootFactory in your

class RootFactory(object):
    """This object sets the security for our application."""
    __acl__ = [
        (Allow, Authenticated, 'view'),
        (Deny, Authenticated, 'login'),
        (Allow, Everyone, 'login'),

    def __init__(self, request):

Now register get_acl_group() function in the config registry to make authorization work. Put in your main method:

def get_acl_group(request):
    return ('view',)

def main(global_config, **settings):
    """Main app configuration binding."""

    config = Configurator(settings=settings,

    # ACL authorization callback for pyramid-upwork
    config.registry.get_acl_group = get_acl_group

    # External includes

    # Views and routing goes here
    # ...

    return config.make_wsgi_app()

You can provide custom forbidden.jinja2 template by overriding asset in your

# Override forbidden template                                                                                                                                                                   config.override_asset(

See template example in pyramid_upwork/templates/forbidden.jinja2.

The “Logout” action is done also via POST request with CSRF protection, see example of “Logout” buttion in pyramid_upwork_example/templates/layout.jinja2.


The project is made by Cyril Panshine (@CyrilPanshine). Bug reports and pull requests are very much welcomed!


Odesk rebranded to Upwork, now using python-upwork library.


  • Due to oDesk Public API change we need to get user information now from


  • Implement bugfix for case when session is broken and request token and secret are not set.


  • Store first and last name in the session for further usage in templates


  • Login and Logout actions are performed via POST and has protection against CSRF attacks


  • Fix BaseHandler obscuring AttributeError during dispatch


  • Use override_offset for overriding forbidden.jinja2 template.
  • If user is authenticated but is not authrized for some view, render forbidden page with Log out link instead of redirect to avoid redirect loop


  • Initial version.
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyramid_upwork-1.1.6.tar.gz (6.4 kB) Copy SHA256 Checksum SHA256 Source Jun 16, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting