GithubHelp home page GithubHelp logo

IndexError about mezzanine2jekyll HOT 12 CLOSED

sjkingo avatar sjkingo commented on July 19, 2024
IndexError

from mezzanine2jekyll.

Comments (12)

sjkingo avatar sjkingo commented on July 19, 2024

from mezzanine2jekyll.

rosslaird avatar rosslaird commented on July 19, 2024

Thanks in advance for the help. I'm using Mezzanine 4.1.0.

from mezzanine2jekyll.

sjkingo avatar sjkingo commented on July 19, 2024

Could you paste the output of pip freeze inside the virtualenv?

from mezzanine2jekyll.

rosslaird avatar rosslaird commented on July 19, 2024

beautifulsoup4==4.4.1 bleach==1.4.2 boto==2.40.0 certifi==2016.2.28 cffi==1.6.0 chardet==2.3.0 cryptography==1.3.2 Django==1.9.6 django-contrib-comments==1.7.1 django-ses==0.7.1 django-simple-captcha==0.5.1 enum34==1.1.6 filebrowser-safe==0.4.3 future==0.15.2 grappelli-safe==0.4.2 gunicorn==19.5.0 html5lib==0.9999999 idna==2.1 ipaddress==1.0.16 -e git+https://github.com/stephenmcd/mezzanine.git@1e343d0b4d98baafa6197773b89f8974abf830e7#egg=Mezzanine mezzanine2jekyll==1.0.0 ndg-httpsclient==0.4.0 oauthlib==1.1.1 Pillow==3.2.0 psycopg2==2.6.1 pyasn1==0.1.9 pycparser==2.14 pyOpenSSL==16.0.0 pytz==2016.4 requests==2.10.0 requests-oauthlib==0.6.1 six==1.10.0 tzlocal==1.2.2

from mezzanine2jekyll.

sjkingo avatar sjkingo commented on July 19, 2024

I can't seem to reproduce, but I believe it may have something to do with the change in arguments handling, given the traceback.

Can you paste the exact command you're trying to run?

from mezzanine2jekyll.

rosslaird avatar rosslaird commented on July 19, 2024

python manage.py mezzanine2jekyll ~/jekyll

from mezzanine2jekyll.

sjkingo avatar sjkingo commented on July 19, 2024

I've just pushed a fix to pypi as version 1.0.1 - could you update and see if the problem is resolved?

from mezzanine2jekyll.

rosslaird avatar rosslaird commented on July 19, 2024

Thanks so much for helping me out with this. It's probably not the kind of thing you really want to be working on...

I've upgraded, and here is the result:

... File "/home/rosslaird/website/website/urls.py", line 55, in <module> url("^$", "mezzanine.pages.views.page", {"slug": "/"}, name="home"), File "/home/rosslaird/.virtualenvs/rosslaird/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 85, in url TypeError('view must be a callable or a list/tuple in the case of include().') TypeError: view must be a callable or a list/tuple in the case of include().

from mezzanine2jekyll.

rosslaird avatar rosslaird commented on July 19, 2024

I created a new instance of Mezzanine locally, imported the existing database into it, and ran the command. Here's what I get (slightly different):

...File "/home/ross/.virtualenvs/rosslaird/lib/python3.6/site-packages/mezzanine2jekyll/management/commands/mezzanine2jekyll.py", line 26, in handle content = post.content.encode('utf-8').replace('\r', '') TypeError: a bytes-like object is required, not 'str'

This error I recognize. It's a python 2 --> 3 version issue. Maybe it helps you to track down the root cause.
Also, in this new instance, the command actually runs for a bit before crashing. So, I think it is getting farther.

from mezzanine2jekyll.

rosslaird avatar rosslaird commented on July 19, 2024

So, a development: the initial error ("view musty be a callable or a list...") does not happen on the local setup. It does happen on the remote setup, with the same database. I can reproduce it on the remote site with this command:

python manage.py dumpdata page --indent 2 > ~/pages.yaml

That command runs perfectly on the local setup. So, this means I can actually get the posts/pages into yaml locally, then use a utility such as html2text to strip the html and end up with pages/posts that can be brought into Jekyll. I can live with this workflow. So, no need to try to figure this out (unless you are driven to do it).

from mezzanine2jekyll.

rosslaird avatar rosslaird commented on July 19, 2024

I realized I was running Python 3 in my local virtualenv, so I created another virtualenv with Python 2.7, and the script ran perfectly. Thanks so much for putting this out there.

from mezzanine2jekyll.

sjkingo avatar sjkingo commented on July 19, 2024

Great to hear you've sorted it out. I should definitely add some tests and CI - this sort of version mismatch would be easily resolved then.

Be aware that some bits of Mezzanine/filebrowser don't yet play 100% well with Django 1.11 or Python 3.5+, in case you're getting some weird errors.

from mezzanine2jekyll.

Related Issues (1)

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.