Django 3.0 added --ignore option
django-admin compilemessages --ignore=cache --ignore=outdated/*/locale
Docs: https://docs.djangoproject.com/en/3.2/ref/django-admin/#cmdoption-compilemessages-ignore
(Method #2)
BEFORE THAT THE BEST HACK I FOUND TO IGNORE THE VENV IS:
cd to project
python ../manage.py makemessages (jumping one directory up)
python ../manage.py compilemessages
(This little hack from a workmate avoids compiling the venv .po)
(Method #3)
And also before, another workaround was trying the more complicated way of using the --exclude flag
usage: django-admin compilemessages [-h] [--version] [-v {0,1,2,3}]
[--settings SETTINGS]
[--pythonpath PYTHONPATH] [--traceback]
[--no-color] [--locale LOCALE]
[--exclude EXCLUDE] [--use-fuzzy]
github
parser.add_argument(
'--exclude', '-x', action='append', default=[],
help='Locales to exclude. Default is none. Can be used multiple times.',
)
Unfortunately this is for locales, but it is the only thing I found so far
From these internal communications on the development of Django, I can see the ignore flag has been copied from makemessages to compilemessages for a future version
For my own usage I used (excluding es and en)
django-admin compilemessages --exclude=sw --exclude=sl --exclude=sk --exclude=km --exclude=sv --exclude=ko --exclude=sq --exclude=sr --exclude=kk --exclude=ka --exclude=es_MX --exclude=fa --exclude=fy --exclude=fr --exclude=en_AU --exclude=ne --exclude=nb --exclude=nn --exclude=nl --exclude=id --exclude=az --exclude=io --exclude=ar --exclude=ia --exclude=kn --exclude=it --exclude=is --exclude=vi --exclude=af --exclude=my --exclude=mr --exclude=uk --exclude=pl --exclude=ur --exclude=mk --exclude=mn --exclude=ml --exclude=he --exclude=hi --exclude=hu --exclude=hr --exclude=en_GB --exclude=pa --exclude=cs --exclude=fi --exclude=cy --exclude=sr_Latn --exclude=os --exclude=pt --exclude=ja --exclude=bs --exclude=br --exclude=bn --exclude=ast --exclude=bg --exclude=hsb --exclude=dsb --exclude=ro --exclude=es_CO --exclude=ru --exclude=et --exclude=eu --exclude=zh_Hant --exclude=zh_Hans --exclude=be --exclude=eo --exclude=el --exclude=da --exclude=de --exclude=pt_BR --exclude=ta --exclude=ca --exclude=te --exclude=es_AR --exclude=th --exclude=lt --exclude=lv --exclude=tr --exclude=tt --exclude=es_VE --exclude=lb --exclude=gl --exclude=ga --exclude=gd --exclude=udm--exclude=sw --exclude=sl --exclude=sk --exclude=km --exclude=sv --exclude=ko --exclude=sq --exclude=sr --exclude=kk --exclude=ka --exclude=es_MX --exclude=fa --exclude=fy --exclude=fr --exclude=en_AU --exclude=ne --exclude=nb --exclude=nn --exclude=nl --exclude=id --exclude=az --exclude=io --exclude=ar --exclude=ia --exclude=kn --exclude=it --exclude=is --exclude=vi --exclude=af --exclude=my --exclude=mr --exclude=uk --exclude=pl --exclude=ur --exclude=mk --exclude=mn --exclude=ml --exclude=he --exclude=hi --exclude=hu --exclude=hr --exclude=en_GB --exclude=pa --exclude=cs --exclude=fi --exclude=cy --exclude=sr_Latn --exclude=os --exclude=pt --exclude=ja --exclude=bs --exclude=br --exclude=bn --exclude=ast --exclude=bg --exclude=hsb --exclude=dsb --exclude=ro --exclude=es_CO --exclude=ru --exclude=et --exclude=eu --exclude=zh_Hant --exclude=zh_Hans --exclude=be --exclude=eo --exclude=el --exclude=da --exclude=de --exclude=pt_BR --exclude=ta --exclude=ca --exclude=te --exclude=es_AR --exclude=th --exclude=lt --exclude=lv --exclude=tr --exclude=tt --exclude=es_VE --exclude=lb --exclude=gl --exclude=ga --exclude=gd --exclude=udm --exclude=zh_CN --exclude=ky --exclude=zh_TW --exclude=no --exclude=pt_PT --exclude=hy
makemessages
and notcompilemessages
. Have you found any solution in the meantime? This thread recommends moving thevenv
folder out of the django project, but the possibility to ignore it in thecompilemessages
command would be preferable. – Irresolution