This commit is contained in:
Alexandre Norman 2025-05-22 22:16:17 +02:00
commit 07dd59f45f
No known key found for this signature in database
15 changed files with 927 additions and 0 deletions

1
bug/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.idea/

28
bug/LICENSE Normal file
View file

@ -0,0 +1,28 @@
BSD 3-Clause License
Copyright (c) 2023, django CMS Association
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

33
bug/README.md Normal file
View file

@ -0,0 +1,33 @@
# Django template for a new django CMS 4 project
A Django template for a typical django CMS installation with no
special bells or whistles. It is supposed as a starting point
for new projects.
If you prefer a different set of template settings, feel free to
create your own templates by cloning this repo.
To install django CMS 4 by hand type the following commands:
1. Create virtual environment and activate it
```
python3 -m venv .venv
source .venv/bin/activate
```
2. Install Django, django CMS and other required packages
```
pip install django-cms
```
3. Create project `<<project_name>>` using this template
```
djangocms <<project_name>>
cd <<project_name>>
```
4. Run testserver
```
./manage.py runserver
```
Note: If you run into a problem of missing dependencies, please
update `pip` using `pip install -U pip` before running the
`djangocms` command.

0
bug/bug/__init__.py Normal file
View file

16
bug/bug/asgi.py Normal file
View file

@ -0,0 +1,16 @@
"""
ASGI config for bug project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bug.settings")
application = get_asgi_application()

235
bug/bug/settings.py Normal file
View file

@ -0,0 +1,235 @@
"""
Django settings for bug project.
Generated by 'djangocms' command using django CMS 5.0.1 and Django 5.2.1.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/topics/settings/
For the full list of Django settings and their values, see
https://docs.djangoproject.com/en/5.2/ref/settings/
For the list of django CMS settings and their values, see
https://docs.django-cms.org/en/release-5.0.x/reference/configuration.html
"""
import os
from pathlib import Path
from django.utils.translation import gettext_lazy as _
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-51d^@jek(@2nw0ltk*uqkh@sh7#h6$z0j4z&v980yhn&b!akv("
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
"djangocms_admin_style",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.sites",
# CMS base apps
"cms",
"menus",
"djangocms_text",
"djangocms_link",
"djangocms_alias",
"djangocms_versioning",
"sekizai",
"treebeard",
"parler",
"filer",
"easy_thumbnails",
"djangocms_frontend",
"djangocms_frontend.contrib.accordion",
"djangocms_frontend.contrib.alert",
"djangocms_frontend.contrib.badge",
"djangocms_frontend.contrib.card",
"djangocms_frontend.contrib.carousel",
"djangocms_frontend.contrib.collapse",
"djangocms_frontend.contrib.content",
"djangocms_frontend.contrib.grid",
"djangocms_frontend.contrib.icon",
"djangocms_frontend.contrib.image",
"djangocms_frontend.contrib.jumbotron",
"djangocms_frontend.contrib.link",
"djangocms_frontend.contrib.listgroup",
"djangocms_frontend.contrib.media",
"djangocms_frontend.contrib.navigation",
"djangocms_frontend.contrib.tabs",
"djangocms_frontend.contrib.utilities",
]
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"cms.middleware.user.CurrentUserMiddleware",
"cms.middleware.page.CurrentPageMiddleware",
"cms.middleware.toolbar.ToolbarMiddleware",
"django.middleware.locale.LocaleMiddleware",
"cms.middleware.language.LanguageCookieMiddleware",
]
ROOT_URLCONF = "bug.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [
os.path.join(BASE_DIR, "bug", "templates"),
],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
"django.template.context_processors.i18n",
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"sekizai.context_processors.sekizai",
"cms.context_processors.cms_settings",
],
},
},
]
THUMBNAIL_PROCESSORS = (
"easy_thumbnails.processors.colorspace",
"easy_thumbnails.processors.autocrop",
"filer.thumbnail_processors.scale_and_crop_with_subject_location",
"easy_thumbnails.processors.filters",
)
WSGI_APPLICATION = "bug.wsgi.application"
# Database
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
# Password validation
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
},
{
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
},
{
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
},
]
# Internationalization
# https://docs.djangoproject.com/en/5.2/topics/i18n/
LANGUAGE_CODE = "en"
LANGUAGES = [
("en", _("English")),
# Add additional languages here
]
TIME_ZONE = "UTC"
USE_I18N = True
USE_L10N = True
USE_THOUSAND_SEPARATOR = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.2/howto/static-files/
STATIC_URL = "static/"
# Default primary key field type
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
# This is a django CMS 4 template
CMS_CONFIRM_VERSION4 = True
# django CMS requires the site framework
# https://docs.django-cms.org/en/release-5.0.x/how_to/multi-site.html
SITE_ID = 1
# A base template is part of this setup
# https://docs.django-cms.org/en/release-5.0.x/reference/configuration.html#cms-templates
CMS_TEMPLATES = (("base.html", _("Standard")),)
# Enable permissions
# https://docs.django-cms.org/en/release-5.0.x/topics/permissions.html
CMS_PERMISSION = True
# Allow admin sidebar to open admin URLs
X_FRAME_OPTIONS = "SAMEORIGIN"
# Enable inline editing with djangocms-text
# https://github.com/django-cms/djangocms-text#inline-editing-feature
TEXT_INLINE_EDITING = True
# Allow deletion of version objects
# https://djangocms-versioning.readthedocs.io/en/latest/settings.html#DJANGOCMS_VERSIONING_ALLOW_DELETING_VERSIONS
DJANGOCMS_VERSIONING_ALLOW_DELETING_VERSIONS = True
# Add project-wide static files directory
# https://docs.djangoproject.com/en/5.2/ref/settings/#staticfiles-dirs
STATICFILES_DIRS = [
BASE_DIR / "bug" / "static",
]
INTERNAL_IPS = [
"127.0.0.1",
]
# Add project-wide static files directory
# https://docs.djangoproject.com/en/5.2/ref/settings/#media-root
MEDIA_URL = "media/"
MEDIA_ROOT = str(BASE_DIR.parent / "media")

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,2 @@
{# Replace this with your base template #}
{% extends "bootstrap5/base.html" %}

33
bug/bug/urls.py Normal file
View file

@ -0,0 +1,33 @@
"""
URL configuration for bug project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls.i18n import i18n_patterns
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views.i18n import JavaScriptCatalog
urlpatterns = i18n_patterns(
path("jsi18n/", JavaScriptCatalog.as_view(), name="javascript-catalog"),
path("admin/", admin.site.urls),
path("filer/", include("filer.urls")),
path("", include("cms.urls")),
)
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

16
bug/bug/wsgi.py Normal file
View file

@ -0,0 +1,16 @@
"""
WSGI config for bug project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bug.settings")
application = get_wsgi_application()

22
bug/manage.py Executable file
View file

@ -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", "bug.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()

6
bug/requirements.in Normal file
View file

@ -0,0 +1,6 @@
djangocms-versioning
djangocms-alias
djangocms-frontend>=2.0.0a1
django-filer
djangocms-text
django-fsm<3