Coder Social home page Coder Social logo

2degrees / django-wsgi Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 15.0 267 KB

Library to make Django applications play nice in WSGI environments

Home Page: https://pythonhosted.org/django-wsgi/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

django-wsgi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-wsgi's Issues

Remove pypy3 from travis

It appears that between the last time travis ran and now pypy3 has also been updated to python 3.5, and the code seems to be incompatible with 3.5 (as the last commit on the test config would suggest).

It seems to work for me with 3.6, so I guess it doesn't use the buggy path for me.

Add WebOb v1 compatibility

I am using buildout with
Django 1.2.5
Paste 1.7.5.1
PasteDeploy 1.3.4
PasteScript 1.7.3
WebOb 1.0.7
twod.wsgi 1.0

I run the paster server:
$ ./bin/paster serve --app-name=development --server-name=development --reload settings.ini

The Django application starts and everything seems normal until I try to run a view that accesses the 'POST' attribute on the request object. When that happens the getattr() method of TwodWSGIRequest is called. This looks for 'POST' in self.environ['webob.adhoc_attrs']. Since that doesn't exist, it raises AttributeError.

I don't understand this at all because 'POST' is supposed to be an attribute on TwodWSGIRequest just like it is on Django's HttpRequest class.

The really weird part is that the request is fine after I inspect it manually during a debugging session. I put a breakpoint before the code that accesses the 'POST' attribute:

> /Users/haitran/Desktop/project/apps/account/views.py(36)login()
     35     import ipdb; ipdb.set_trace()
---> 36     if request.method == 'POST':
     37         form = LoginForm(request.POST)

ipdb> request

<WSGIRequest
GET:<QueryDict: {}>,
POST:<could not parse>,   # <-- why is this not correct?
 ...
 'wsgi.version': (1, 0)}>

ipdb> request

<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {u'next_url': [u''], u'password': [u'passwd'], u'email': [u'[email protected]']}>,
 ...
 'wsgi.version': (1, 0)}>

Note that the first time I look at the request object, the 'POST' attribute is printed as "". The second time I look at the request object, everything is fine with the POST attribute.

This problem does not happen when using WebOb 0.9.8. It happens when using WebOb 1.0.7.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.