From f66bfd17e20eed89838ae0888a3de3f38928c8cb Mon Sep 17 00:00:00 2001 From: vitaliypopel Date: Fri, 20 Sep 2024 14:28:08 +0300 Subject: [PATCH 1/3] bug: Fixed bug with sequence python versions --- .github/workflows/beta.yml | 2 +- examples/example/example/__init__.py | 0 examples/example/example/asgi.py | 16 +++ examples/example/example/settings.py | 124 ++++++++++++++++++ examples/example/example/urls.py | 23 ++++ examples/example/example/wsgi.py | 16 +++ examples/example/example_app/__init__.py | 0 examples/example/example_app/apps.py | 6 + .../example_app/migrations/__init__.py | 0 examples/example/example_app/tests.py | 1 + examples/example/example_app/urls.py | 7 + examples/example/example_app/views.py | 3 + examples/example/manage.py | 22 ++++ 13 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 examples/example/example/__init__.py create mode 100644 examples/example/example/asgi.py create mode 100644 examples/example/example/settings.py create mode 100644 examples/example/example/urls.py create mode 100644 examples/example/example/wsgi.py create mode 100644 examples/example/example_app/__init__.py create mode 100644 examples/example/example_app/apps.py create mode 100644 examples/example/example_app/migrations/__init__.py create mode 100644 examples/example/example_app/tests.py create mode 100644 examples/example/example_app/urls.py create mode 100644 examples/example/example_app/views.py create mode 100755 examples/example/manage.py diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index a8052bd..04944ee 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: '3.8' - name: Install dependencies run: | diff --git a/examples/example/example/__init__.py b/examples/example/example/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/example/example/asgi.py b/examples/example/example/asgi.py new file mode 100644 index 0000000..15e7f85 --- /dev/null +++ b/examples/example/example/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for example 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.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example.settings') + +application = get_asgi_application() diff --git a/examples/example/example/settings.py b/examples/example/example/settings.py new file mode 100644 index 0000000..877987f --- /dev/null +++ b/examples/example/example/settings.py @@ -0,0 +1,124 @@ +""" +Django settings for example project. + +Generated by 'django-admin startproject' using Django 5.1.1. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/ref/settings/ +""" + +from pathlib import Path + +# 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.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-a74g_9ab0@lt#9=x%)jw-sp26^1#-(scx0dx8b*d$*oet0%7=m' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'app', +] + +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', +] + +ROOT_URLCONF = 'example.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'example.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/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.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.1/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/examples/example/example/urls.py b/examples/example/example/urls.py new file mode 100644 index 0000000..68dd02f --- /dev/null +++ b/examples/example/example/urls.py @@ -0,0 +1,23 @@ +""" +URL configuration for example project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.1/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.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', include('example_app.urls')), +] diff --git a/examples/example/example/wsgi.py b/examples/example/example/wsgi.py new file mode 100644 index 0000000..7b44f02 --- /dev/null +++ b/examples/example/example/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for example 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.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example.settings') + +application = get_wsgi_application() diff --git a/examples/example/example_app/__init__.py b/examples/example/example_app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/example/example_app/apps.py b/examples/example/example_app/apps.py new file mode 100644 index 0000000..5c58f91 --- /dev/null +++ b/examples/example/example_app/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ExampleAppConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'example_app' diff --git a/examples/example/example_app/migrations/__init__.py b/examples/example/example_app/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/example/example_app/tests.py b/examples/example/example_app/tests.py new file mode 100644 index 0000000..2e9cb5f --- /dev/null +++ b/examples/example/example_app/tests.py @@ -0,0 +1 @@ +from django.test import TestCase diff --git a/examples/example/example_app/urls.py b/examples/example/example_app/urls.py new file mode 100644 index 0000000..e608bbb --- /dev/null +++ b/examples/example/example_app/urls.py @@ -0,0 +1,7 @@ +from django_routify import include_router + +from .views import router + +urlpatterns = [ + include_router(router), +] diff --git a/examples/example/example_app/views.py b/examples/example/example_app/views.py new file mode 100644 index 0000000..73f53ee --- /dev/null +++ b/examples/example/example_app/views.py @@ -0,0 +1,3 @@ +from django_routify import Router + +router: Router diff --git a/examples/example/manage.py b/examples/example/manage.py new file mode 100755 index 0000000..625a05a --- /dev/null +++ b/examples/example/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', 'example.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() From 8213ee40866650723dafc1402f4552da5d7c5c3d Mon Sep 17 00:00:00 2001 From: vitaliypopel Date: Fri, 20 Sep 2024 14:28:24 +0300 Subject: [PATCH 2/3] bug: Fixed bug with sequence python versions --- examples/example/example/__init__.py | 0 examples/example/example/asgi.py | 16 --- examples/example/example/settings.py | 124 ------------------ examples/example/example/urls.py | 23 ---- examples/example/example/wsgi.py | 16 --- examples/example/example_app/__init__.py | 0 examples/example/example_app/apps.py | 6 - .../example_app/migrations/__init__.py | 0 examples/example/example_app/tests.py | 1 - examples/example/example_app/urls.py | 7 - examples/example/example_app/views.py | 3 - examples/example/manage.py | 22 ---- 12 files changed, 218 deletions(-) delete mode 100644 examples/example/example/__init__.py delete mode 100644 examples/example/example/asgi.py delete mode 100644 examples/example/example/settings.py delete mode 100644 examples/example/example/urls.py delete mode 100644 examples/example/example/wsgi.py delete mode 100644 examples/example/example_app/__init__.py delete mode 100644 examples/example/example_app/apps.py delete mode 100644 examples/example/example_app/migrations/__init__.py delete mode 100644 examples/example/example_app/tests.py delete mode 100644 examples/example/example_app/urls.py delete mode 100644 examples/example/example_app/views.py delete mode 100755 examples/example/manage.py diff --git a/examples/example/example/__init__.py b/examples/example/example/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/examples/example/example/asgi.py b/examples/example/example/asgi.py deleted file mode 100644 index 15e7f85..0000000 --- a/examples/example/example/asgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -ASGI config for example 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.1/howto/deployment/asgi/ -""" - -import os - -from django.core.asgi import get_asgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example.settings') - -application = get_asgi_application() diff --git a/examples/example/example/settings.py b/examples/example/example/settings.py deleted file mode 100644 index 877987f..0000000 --- a/examples/example/example/settings.py +++ /dev/null @@ -1,124 +0,0 @@ -""" -Django settings for example project. - -Generated by 'django-admin startproject' using Django 5.1.1. - -For more information on this file, see -https://docs.djangoproject.com/en/5.1/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/5.1/ref/settings/ -""" - -from pathlib import Path - -# 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.1/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-a74g_9ab0@lt#9=x%)jw-sp26^1#-(scx0dx8b*d$*oet0%7=m' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'app', -] - -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', -] - -ROOT_URLCONF = 'example.urls' - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - ], - }, - }, -] - -WSGI_APPLICATION = 'example.wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/5.1/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', - } -} - - -# Password validation -# https://docs.djangoproject.com/en/5.1/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.1/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'UTC' - -USE_I18N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/5.1/howto/static-files/ - -STATIC_URL = 'static/' - -# Default primary key field type -# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field - -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/examples/example/example/urls.py b/examples/example/example/urls.py deleted file mode 100644 index 68dd02f..0000000 --- a/examples/example/example/urls.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -URL configuration for example project. - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/5.1/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.contrib import admin -from django.urls import path, include - -urlpatterns = [ - path('admin/', admin.site.urls), - path('', include('example_app.urls')), -] diff --git a/examples/example/example/wsgi.py b/examples/example/example/wsgi.py deleted file mode 100644 index 7b44f02..0000000 --- a/examples/example/example/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for example 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.1/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'example.settings') - -application = get_wsgi_application() diff --git a/examples/example/example_app/__init__.py b/examples/example/example_app/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/examples/example/example_app/apps.py b/examples/example/example_app/apps.py deleted file mode 100644 index 5c58f91..0000000 --- a/examples/example/example_app/apps.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.apps import AppConfig - - -class ExampleAppConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'example_app' diff --git a/examples/example/example_app/migrations/__init__.py b/examples/example/example_app/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/examples/example/example_app/tests.py b/examples/example/example_app/tests.py deleted file mode 100644 index 2e9cb5f..0000000 --- a/examples/example/example_app/tests.py +++ /dev/null @@ -1 +0,0 @@ -from django.test import TestCase diff --git a/examples/example/example_app/urls.py b/examples/example/example_app/urls.py deleted file mode 100644 index e608bbb..0000000 --- a/examples/example/example_app/urls.py +++ /dev/null @@ -1,7 +0,0 @@ -from django_routify import include_router - -from .views import router - -urlpatterns = [ - include_router(router), -] diff --git a/examples/example/example_app/views.py b/examples/example/example_app/views.py deleted file mode 100644 index 73f53ee..0000000 --- a/examples/example/example_app/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django_routify import Router - -router: Router diff --git a/examples/example/manage.py b/examples/example/manage.py deleted file mode 100755 index 625a05a..0000000 --- a/examples/example/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/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', 'example.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() From 36c69c82fbf3f2e87e69e9ec4c7df371ffb1f31f Mon Sep 17 00:00:00 2001 From: vitaliypopel Date: Fri, 20 Sep 2024 14:31:19 +0300 Subject: [PATCH 3/3] bug: Fixed bug with sequence python versions --- .github/workflows/beta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index a8052bd..04944ee 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: '3.8' - name: Install dependencies run: |