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

Shpaml does not seem to be compatible with Django 1.8/Python 2.7 at all. #20

Open
bschuon opened this issue Feb 25, 2016 · 3 comments
Open

Comments

@bschuon
Copy link

bschuon commented Feb 25, 2016

When installing Shpaml in a Django 1.8/Python 2.7 system, as soon as the templates loaders settings is added, you get an error:

"Module "shpaml" does not define a "Loader" attribute/class"

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, "myproject", "templates")],
        'OPTIONS': {
            'context_processors': [
                # Insert your TEMPLATE_CONTEXT_PROCESSORS here or use this
                # list if you haven't customized them:
                'django.contrib.auth.context_processors.auth',
                'django.template.context_processors.debug',
                'django.template.context_processors.i18n',
                'django.template.context_processors.media',
                'django.template.context_processors.static',
                'django.template.context_processors.tz',
                'django.contrib.messages.context_processors.messages',
                'django.core.context_processors.request',
            ],
            'loaders': [
                ('shpaml.Loader',
                    ('django.template.loaders.filesystem.Loader',)
                ),  
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',  
            ],
            'debug': False,
        },
    },
]
@dm-coding
Copy link

OP, did you ever discover a solution?

@montythreecard
Copy link

Yes. By using SHPAML in the project as an app (and adding it to the apps in the settings), and REMOVING it from the site-packages with PIP, it then works ok.

@bschuon
Copy link
Author

bschuon commented Nov 18, 2019

Finally realized that you need to pip install django-shpaml, NOT pip install shpaml. And remove the old shpaml if installed. then everything is fine.

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

3 participants