Closed zarino closed 10 years ago
Related? Once I manually pip install django-debug-toolbar
, and get a ./manage.py runserver
up and running, accessing the website results in another Python exception in the server log:
ImproperlyConfigured: Error importing module pagination.middleware: "No module named pagination.middleware"
The django-pagination package isn't in requirements.txt either.
Installing django-pagination, then restarting the server, gives me a Django exception in the web browser:
ImportError at /
No module named oauthlib.common
As you'd expect, manually pip installing OAuthLib solved it, and I finally got through to the sayit.mysociety.org homepage.
The debug toolbar is an optional component, based upon your setting of STAGING
in conf/general.yml
. If you have debug turned on, then you will want to install development dependencies, with pip install -e git+https://github.com/mysociety/sayit#egg=django-sayit[develop]
(and [test] too I guess, it should probably include the test subset in develop) - sorry, this repo's README is a little out of date to the changes in sayit to only install required components by default, you can read more at http://mysociety.github.io/sayit/develop/ and http://mysociety.github.io/sayit/test/ .
I've removed all mention of pagination, I missed a couple of lines when that was removed. thanks.
i don’t understand the oauthlib issue, because that should have been installed as a dependency of django-allauth - was there any error in the first run of installing packages? It does get installed here:
$ pip install django-allauth
Downloading/unpacking django-allauth
[...]
Downloading/unpacking oauthlib>=0.4.2 (from requests-oauthlib>=0.3.0->django-allauth)
[...]
Odd. I can indeed see that it was downloaded:
Downloading/unpacking python-openid>=2.2.5 (from django-allauth==0.16.1->-r requirements.txt (line 2))
Downloading python-openid-2.2.5.tar.gz (301kB): 301kB downloaded
Running setup.py (path:/Users/zarinozappia/.virtualenvs/sayit-ms-org/build/python-openid/setup.py) egg_info for package python-openid
warning: no files found matching 'CHANGELOG'
warning: no files found matching '*.css' under directory 'doc'
warning: no files found matching '*.html' under directory 'doc'
Downloading/unpacking requests-oauthlib>=0.3.0 (from django-allauth==0.16.1->-r requirements.txt (line 2))
Downloading requests_oauthlib-0.4.1-py2.py3-none-any.whl
Wonder what's going on?
That's not oauthlib, that's "requests-oauthlib". "oauthlib" should be installed after that as a requirement of "requests-oauthlib".
Is this all sorted?
The README still could do with an update to explain what you'd need to do to run in development. I assume oauthlib issue was temporary somehow.
I've change the settings file so that it will ignore debug toolbar if it's not installed (regardless of the DEBUG
setting). So to use the toolbar, you just have to have DEBUG True and pip install it, and the codebase will handle it whichever way.
I recently installed sayit.mysociety.org into a new virtualenv, roughly following the readme where appropriate. After activating the new empty virtualenv, I ran:
Which worked (once I'd also reinstalled the XCode command line tools – don't ask).
But running any of the
./manage.py
commands results in an error like:My
pip freeze
looks like:The django-debug-toolbar package isn't included in requirements.txt. Should it be? Or am I missing something?