{"id":24376,"library":"pypugjs","title":"PyPugJS","description":"PyPugJS is a Python port of the PugJS (formerly Jade) template engine. It provides a syntax adapter for Django, Jinja2, Mako, and Tornado templates. The current version is 6.0.3, with an active development cadence. Note that v6.0.0 dropped support for Python versions below 3.10.","status":"active","version":"6.0.3","language":"python","source_language":"en","source_url":"https://github.com/kakulukia/pypugjs","tags":["template-engine","pug","jade","django","jinja2","mako","tornado"],"install":[{"cmd":"pip install pypugjs","lang":"bash","label":"Standard installation"}],"dependencies":[{"reason":"Optional: for Django template adapter","package":"Django","optional":true},{"reason":"Optional: for Jinja2 adapter","package":"Jinja2","optional":true},{"reason":"Optional: for Mako adapter","package":"Mako","optional":true},{"reason":"Optional: for Tornado adapter","package":"Tornado","optional":true}],"imports":[{"note":"For Django integration","symbol":"PyPugJSTemplate","correct":"from pypugjs.ext.django import PyPugJSTemplate"},{"note":"Wrong module; Preprocessor is in the jinja extension","wrong":"from pypugjs import Preprocessor","symbol":"Preprocessor","correct":"from pypugjs.ext.jinja import Preprocessor"}],"quickstart":{"code":"from pypugjs.ext.django import PyPugJSTemplate\n\n# Use as Django template backend:\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [],\n        'OPTIONS': {\n            'loaders': [\n                ('django.template.loaders.cached.Loader', [\n                    'django.template.loaders.filesystem.Loader',\n                ]),\n            ],\n            'builtins': ['pypugjs.ext.django.templatetags'],\n        },\n    },\n]","lang":"python","description":"Basic Django integration with PyPugJS"},"warnings":[{"fix":"Upgrade Python to 3.10+ or pin pypugjs to <6.0.0","message":"v6.0.0 dropped support for Python versions below 3.10. If you are on an older Python version, stay on v5.x.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Use pypugjs instead of pyjade","message":"The 'pyjade' package is deprecated in favor of 'pypugjs'. Many older tutorials reference pyjade.","severity":"deprecated","affected_versions":"all"},{"fix":"Use consistent spacing (spaces preferred) in .pug files","message":"Template syntax uses significant indentation; mixing tabs and spaces can cause parse errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install pypugjs' in the correct Python environment.","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'pypugjs'"},{"fix":"Use 'from pypugjs.ext.jinja import Preprocessor' instead.","cause":"Incorrect import path; Preprocessor is in the jinja extension.","error":"ImportError: cannot import name 'Preprocessor' from 'pypugjs'"},{"fix":"Ensure consistent indentation (use spaces, 2 or 4 per level).","cause":"Indentation errors in .pug file, often due to mixing spaces and tabs.","error":"TemplateSyntaxError: Unexpected token 'indent'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}