2degrees / django-wsgi Goto Github PK
View Code? Open in Web Editor NEWLibrary to make Django applications play nice in WSGI environments
Home Page: https://pythonhosted.org/django-wsgi/
License: BSD 3-Clause "New" or "Revised" License
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
The config parser should support settings which can be None or a string.
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.
See master...1.1
If anyone is still around here - with Django 1.10 no longer supported upstream, it would be great to get the code 2+ compliant. There may be other issues I haven't encountered yet but https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#django.contrib.auth.models.User.is_authenticated
has changed from a method to a bool.
So people could override the application more easily, as in Pylons/TG2.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.