Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin six.py within silk to avoid version incompatibility. #70

Closed
softshape opened this issue May 29, 2015 · 8 comments
Closed

Pin six.py within silk to avoid version incompatibility. #70

softshape opened this issue May 29, 2015 · 8 comments
Labels

Comments

@softshape
Copy link

Just installed silk, but after this Django won't start.

File "C:\Python27\lib\site-packages\silk\urls.py", line 6, in from silk.views.request_detail import RequestView
File "C:\Python27\lib\site-packages\silk\views\request_detail.py", line 8, in from silk.code_generation.curl import curl_cmd
File "C:\Python27\lib\site-packages\silk\code_generation\curl.py", line 5, in from six.moves.urllib.parse import urlencode
ImportError: No module named urllib.parse

What is the six module?

@mtford90
Copy link
Collaborator

Hmm, what version of six do you have installed? Six is used for py2/py3 compatibility.

@softshape
Copy link
Author

Django 1.8 has \site-packages\django\utils\six.py version 1.9.0

@mtford90
Copy link
Collaborator

Silk won't use Django's version of six but rather whatever is available within your environment. You can see in requirements.txt that I used six 1.6 when developing.

Can you run pip freeze in your dev environment and see which version you have?

I suspect I will probably need to copy what Django does and include six.py within the project e.g. silk.utils.six.

@softshape
Copy link
Author

Found another (old) copy of six.py in "requests" module and updated it to Django's copy. Now it starts OK, but crashes after server request. Log says-

IntegrityError at /
null value in column "view_name" violates not-null constraint
Exception Location: C:\Python27\lib\site-packages\django\db\backends\utils.py in execute, line 64

@mtford90 mtford90 changed the title import six error Pin six.py within silk to avoid version incompatibility. May 29, 2015
@mtford90 mtford90 added the bug label May 29, 2015
@mtford90
Copy link
Collaborator

Ok, you're now experiencing #66 which is fixed in master but not released yet. I'll pin six.py before making a release but for now you can run:

pip install -e git+https://github.com/mtford90/silk.git#egg=silk

To use silk master which should fix that IntegrityError

@softshape
Copy link
Author

It's still there, the same error. I also tried to delete silk tables and recreate them with syncdb but it this won't work. Do you know how to create them without syncdb?

@mtford90
Copy link
Collaborator

Ahhh figured it out, here is the field declaration:

view_name = CharField(max_length=300, db_index=True, blank=True, default='', null=True)

However the initial migrations were never updated with null=True. I have updated this and pushed to master. Please try re-installing from master, drop the tables and execute syncdb/migrate again. Let me know if it works :)

@mtford90
Copy link
Collaborator

mtford90 commented Jun 4, 2015

Okay six is now pinned within master so should be no more six compat issues like this.

@mtford90 mtford90 closed this as completed Jun 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants