0

I am working on a django project where Installed a package called jsonify which is to be used in the django template from https://pypi.org/project/jsonify/ & added in the installed apps:

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "jsonify",
    "main",
]

In my local environment it works just fine but when I deployed to heroku I keep

'jsonify' is not a registered tag library. Must be one of: admin_list admin_modify admin_urls cache i18n l10n log static to_and tz

Also note I have also made my own custom template tag "to_and" which works perfectly fine. This only happens in production in heroku and not in my local envirnoment. Thanks in advance

Ankit Tiwari
  • 4,438
  • 4
  • 14
  • 41
Hash Line
  • 35
  • 7
  • Did you followed this steps https://stackoverflow.com/a/47085113/14457833 and please read this also https://stackoverflow.com/a/42881074/14457833 – Ankit Tiwari Nov 14 '21 at 16:32
  • yeah I did. Like i said , my custom template tag works just fine. Only issue is with jsonify which i installed using pip. That too works fine in my local env – Hash Line Nov 14 '21 at 16:37
  • After installing **jsonify** did you added that package inside your **requirements.txt** file ? because Heroku installes all available packages from **requirements.txt** file and if any dependency is missing than your application will crash – Ankit Tiwari Nov 15 '21 at 05:50
  • Yes I did add jsonify to requiements.txt – Hash Line Nov 15 '21 at 06:41
  • can you provide screen shot or code of full traceback – Ankit Tiwari Nov 15 '21 at 07:26

1 Answers1

0

jsonify is a function in Flask's flask. JSON module. I recommend to use JsonResponse built-in function of Django. Or just

Deepak
  • 1
  • 1
  • (a) `jsonify` also exists as a [standalone library](https://pypi.org/project/jsonify/). (b) Can you provide more information about `JsonResponse`? (c) "Or just"… what? Please read [answer]. – ChrisGPT was on strike Nov 14 '21 at 18:59