eudicots / Cactus

Static site generator for designers. Uses Python and Django templates.
BSD 3-Clause "New" or "Revised" License
3.47k stars 314 forks source link

Blog plugin doesn't work due to django.contrib.markup deprecation #102

Open claudyus opened 10 years ago

claudyus commented 10 years ago

Hi all, I'm trying to use blog plugin on site hosted on gh-pages and I get the following error:

$ cactus serve
No configuration file found at config.json
Traceback (most recent call last):
  File "/usr/local/bin/cactus", line 9, in <module>
    load_entry_point('Cactus==3.0.0', 'console_scripts', 'cactus')()
  File "/usr/local/lib/python2.7/dist-packages/cactus/cli.py", line 114, in main
    args.target(**{k: v for k, v in vars(args).items() if k != 'target'})
  File "/usr/local/lib/python2.7/dist-packages/cactus/cli.py", line 54, in serve
    site.serve(port=port, browser=browser)
  File "/usr/local/lib/python2.7/dist-packages/cactus/site.py", line 440, in serve
    self.build()
  File "/usr/local/lib/python2.7/dist-packages/cactus/site.py", line 240, in build
    self.plugin_manager.preBuild(self)
  File "/usr/local/lib/python2.7/dist-packages/cactus/plugin/manager.py", line 31, in call
    _meth(*args, **kwargs)
  File "/home/claudyus/code/LXC-Web-Panel/gh-pages/site-src/plugins/blog.py", line 54, in preBuild
    postContext['body'] = getNode(get_template(page.path), name="news")
  File "/usr/lib/python2.7/dist-packages/django/template/loader.py", line 138, in get_template
    template, origin = find_template(template_name)
  File "/usr/lib/python2.7/dist-packages/django/template/loader.py", line 121, in find_template
    loader = find_template_loader(loader_name)
  File "/usr/lib/python2.7/dist-packages/django/template/loader.py", line 94, in find_template_loader
    TemplateLoader = import_by_path(loader)
  File "/usr/lib/python2.7/dist-packages/django/utils/module_loading.py", line 21, in import_by_path
    module = import_module(module_path)
  File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/usr/lib/python2.7/dist-packages/django/template/loaders/app_directories.py", line 25, in <module>
    raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError django.contrib.markup: No module named markup

In https://docs.djangoproject.com/en/1.7/internals/deprecation/ the django.contrib.markup was deprecated in Django=1.6 while pip install cactus installer Django=1.6.1

How to around the issues?

$ sudo pip install cactus 
Requirement already satisfied (use --upgrade to upgrade): cactus in /usr/local/lib/python2.7/dist-packages
Downloading/unpacking Django==1.5.5 (from cactus)
  Downloading Django-1.5.5.tar.gz (8.1MB): 8.1MB downloaded
  Running setup.py (path:/tmp/pip_build_root/Django/setup.py) egg_info for package Django

    warning: no previously-included files matching '__pycache__' found under directory '*'
    warning: no previously-included files matching '*.py[co]' found under directory '*'
Requirement already satisfied (use --upgrade to upgrade): markdown2 in /usr/local/lib/python2.7/dist-packages (from cactus)
Requirement already satisfied (use --upgrade to upgrade): argparse in /usr/lib/python2.7 (from cactus)
Requirement already satisfied (use --upgrade to upgrade): keyring in /usr/lib/python2.7/dist-packages (from cactus)
Requirement already satisfied (use --upgrade to upgrade): boto>=2.4.1 in /usr/lib/python2.7/dist-packages (from cactus)
Downloading/unpacking tornado>=3.2 (from cactus)
  Downloading tornado-4.0.1.tar.gz (314kB): 314kB downloaded
  Running setup.py (path:/tmp/pip_build_root/tornado/setup.py) egg_info for package tornado

Requirement already satisfied (use --upgrade to upgrade): colorlog in /usr/local/lib/python2.7/dist-packages (from cactus)
Requirement already satisfied (use --upgrade to upgrade): certifi in /usr/local/lib/python2.7/dist-packages (from tornado>=3.2->cactus)
Requirement already satisfied (use --upgrade to upgrade): backports.ssl-match-hostname in /usr/local/lib/python2.7/dist-packages (from tornado>=3.2->cactus)
Installing collected packages: Django, tornado
  Found existing installation: Django 1.6.1
    Uninstalling Django:
      Successfully uninstalled Django
  Running setup.py install for Django
    changing mode of build/scripts-2.7/django-admin.py from 644 to 755

    warning: no previously-included files matching '__pycache__' found under directory '*'
    warning: no previously-included files matching '*.py[co]' found under directory '*'
    changing mode of /usr/local/bin/django-admin.py to 755

    ========
    WARNING!
    ========

    You have just installed Django over top of an existing
    installation, without removing it first. Because of this,
    your install may now include extraneous files from a
    previous version that have since been removed from
    Django. This is known to cause a variety of problems. You
    should manually remove the

    /usr/lib/python2.7/dist-packages/django

    directory and re-install Django.

  Found existing installation: tornado 3.1.1
    Uninstalling tornado:
      Successfully uninstalled tornado
  Running setup.py install for tornado
    building 'tornado.speedups' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c tornado/speedups.c -o build/temp.linux-x86_64-2.7/tornado/speedups.o
    tornado/speedups.c:49:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     initspeedups() {
     ^
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/tornado/speedups.o -o build/lib.linux-x86_64-2.7/tornado/speedups.so

Successfully installed Django tornado
Cleaning up...
Alir3z4 commented 9 years ago

https://github.com/Alir3z4/django-markwhat is a drop in replacement for django.contrib.markup ;)

Alir3z4 commented 9 years ago

@claudyus I just submitted #106 for review, that patch will fix the issue.