pythondjangodjango-celery-beat

How can I get path of 3rd party app in Django settings.py


I install django_celery_beat app in Django settings.py file

INSTALLED_APPS = [
...,
'django_celery_beat',

]

It has its own locale dir.

enter image description here

As I understand I need to add this path to LOCALE_PATHS in settings.py. How can I get it? Hardcoding is not an option, of cause.


Solution

  • So I found the following solutions that works:

    import importlib
    
    LOCALE_PATHS = [
        ...,
        os.path.join(        
            os.path.dirname(importlib.util.find_spec('django_celery_beat').origin),
            'locale/',
        ),
    ]