diff --git a/manage.py b/manage.py new file mode 100755 index 00000000..13f6f27c --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'publik_base_theme.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + 'available on your PYTHONPATH environment variable? Did you ' + 'forget to activate a virtual environment?' + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/publik_base_theme/__init__.py b/publik_base_theme/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/publik_base_theme/management/__init__.py b/publik_base_theme/management/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/publik_base_theme/management/commands/__init__.py b/publik_base_theme/management/commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/publik_base_theme/management/commands/makemessages.py b/publik_base_theme/management/commands/makemessages.py new file mode 100644 index 00000000..d5c01688 --- /dev/null +++ b/publik_base_theme/management/commands/makemessages.py @@ -0,0 +1,29 @@ +# publik-base-theme +# Copyright (C) 2014-2024 Entr'ouvert +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +from django.core.management.commands import makemessages + + +class Command(makemessages.Command): + def handle(self, *args, **options): + if not options.get('add_location') and self.gettext_version >= (0, 19): + options['add_location'] = 'file' + return super().handle(*args, **options) + + def find_files(self, root): + for file in super().find_files('templates'): + file.locale_dir = 'publik_base_theme/locale' + yield file diff --git a/publik_base_theme/settings.py b/publik_base_theme/settings.py new file mode 100644 index 00000000..3649150a --- /dev/null +++ b/publik_base_theme/settings.py @@ -0,0 +1,23 @@ +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + +# Application definition + +INSTALLED_APPS = ['publik_base_theme'] + +# Internationalization +# https://docs.djangoproject.com/en/3.2/topics/i18n/ + +LANGUAGE_CODE = 'fr-fr' + +TIME_ZONE = 'Europe/Paris' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + +LOCALE_PATHS = (BASE_DIR / 'publik_base_theme' / 'locale',)