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

release for Django 1.8 #185

Open
edemocracy opened this issue Apr 1, 2015 · 12 comments
Open

release for Django 1.8 #185

edemocracy opened this issue Apr 1, 2015 · 12 comments

Comments

@edemocracy
Copy link
Contributor

Please release a new version compatible with the new Django 1.8. thank you

@chompomonim
Copy link

yeah, django 1.8 support would be great

@ErickAgrazal
Copy link

Does it have support for django 1.8?

@ghost
Copy link

ghost commented Apr 20, 2015

I'm using current master with django 1.8. Just make sure that you use the new TEMPLATES configuration variable, and it works: https://docs.djangoproject.com/en/1.8/topics/templates/#configuration

@ekaradon
Copy link

@LuminescentOne, For my part, I do not get it working. Files are being parsed but not interpreted. Could you please be more specific about what we have to do? Just adding the default TEMPLATES configuration seems to be not enough, and adding loaders as option in it broke the rendering with the following error:

'module' object has no attribute 'add_to_builtins'

@TheRightChoyce
Copy link

@ekaradon and for anyone else having issues -- @LuminescentOne is correct, you follow the new syntax. However, the issue I ran into was the default version of pyjade on PIP wasn't up to date, and that caused me to install a version without 1.8 support.

To work around, I installed pyjade directly from the repo:

pip install git+https://github.com/syrusakbary/pyjade.git

And then updated my settings to look like this:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django.core.context_processors.request'
            ],
            'loaders': [
                ('pyjade.ext.django.Loader', (
                    'django.template.loaders.filesystem.Loader',
                    'django.template.loaders.app_directories.Loader',
                ))
            ]
        },
    },
]

@ekaradon
Copy link

Thanks @TheRightChoyce & @LuminescentOne; it is now working. Forgotten to directly update through git indeed.

@ErickAgrazal
Copy link

It worked to me too. Thanks @TheRightChoyce

@marekrogala
Copy link

I confirm, you need to install the github version. Could the package maintainer bump the PIP version? It is clearly different from the repo version.

@syrusakbary
Copy link
Owner

@marekrogala Done. The version compatible with Django 1.8 is pyjade 3.1.0 https://pypi.python.org/pypi/pyjade/3.1.0

@beltiras
Copy link

As far as I can tell this has regressed for Django 1.8.5 and pyjade 3.1.0

I'm using a very simple setup, clean virtualenv, fresh project making only changes to the settings as described and a single template jade.jade containing the code from the frontpage.

test/test/settings.py:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': ['/var/www/test/templates',],
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                'django.core.context_processors.request'
                ],
            'loaders': [
               ('pyjade.ext.django.Loader', (
                   'django.template.loaders.filesystem.Loader',
                   'django.template.loaders.app_directories.Loader',
                   )
                )
               ],
            },
        },
]

test/templates/jade.jade:

!!! 5
html(lang="en")
  head
    title= pageTitle
    script(type='text/javascript')
      if (foo) {
         bar()
      }
  body
    h1.title Jade - node template engine
    #container
      if youAreUsingJade
        p You are amazing
      else
        p Get on it!

test/test/urls.py:

from django.conf.urls import url
from django.contrib import admin
from django.shortcuts import render

urlpatterns = [
    url(r'^jade/$', lambda r:render(r,"jade.jade")),
    url(r'^admin/', admin.site.urls),
]

Results in Could not parse the remainder: '(foo)' from '(foo)'

I can be sure it's using pyjade because the traceback contains:
image

pip freeze:

Django==1.8.5
argparse==1.2.1
pyjade==3.1.0
six==1.10.0
wsgiref==0.1.2

Tried every minor version from 1.8.1 - 1.8.5.

I've also been trying to get pyjade to work with Django 1.9 with little success. I would be willing to put some time into making pyjade ready for Django 1.9.

@beltiras
Copy link

Turns out I was missing the default template tags to render the javascript portion of the demo. I'm hitting a wall how to incorporate them thou ......

@dbykadorov
Copy link

@arnists I have pyjade 3.1.0 up and running with django 1.8.5 but every step is very painful for me.

By the way, if you will add a dot at the end of the script definition:

script(type='text/javascript').
      if (foo) {
         bar()
      }

the template will render corectly http://joxi.ru/LmG3459fxQXKml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants