From b173d7d8a26b02860576efb691b2a2deb41a2851 Mon Sep 17 00:00:00 2001 From: PCoder Date: Fri, 19 May 2023 13:42:32 +0000 Subject: [PATCH 01/19] Fix requirements --- requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index 8d04a189..fd20c92e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,7 +25,7 @@ django-compressor==2.0 django-debug-toolbar==1.4 python-dotenv==0.10.3 django-extensions==1.6.7 -django-filer==2.1.2 +django-filer==1.2.0 django-filter==0.13.0 django-formtools==1.0 django-guardian==1.4.4 @@ -36,7 +36,7 @@ django-model-utils==2.5 django-mptt==0.8.4 django-parler==1.6.3 django-phonenumber-field==1.1.0 -django-polymorphic==0.9.2 +django-polymorphic==0.8.1 django-reversion==1.10.2 django-sekizai==0.9.0 django-sortedm2m==1.2.2 @@ -50,7 +50,7 @@ django-templatetag-sugar==1.0 django-treebeard==4.0.1 djangocms-admin-style==1.1.1 djangocms-apphook-setup==0.1.2 -djangocms-blog==0.9.0 +djangocms-blog==0.8.13 djangocms-file==1.0 djangocms-flash==0.3.0 djangocms-googlemap==0.4.0 @@ -75,7 +75,7 @@ python-dateutil==2.5.3 python-slugify==1.2.0 pytz==2016.4 rcssmin==1.0.6 -requests==2.10.0 +requests>=2.20 rjsmin==1.0.12 six==1.10.0 sqlparse==0.1.19 -- 2.45.2 From 8ba6ecadf21b8dc89f9cb8d878ed5c39bdc2714a Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 23 May 2023 08:10:26 +0000 Subject: [PATCH 02/19] Library updates -- still fails on installing pillow --- Dockerfile | 23 ++++++++++++++++++++--- requirements.txt | 4 ++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 50b81cbb..e522f0d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ FROM python:3.10.0-alpine3.15 -WORKDIR /usr/src/app +WORKDIR /app + +COPY . /app/ RUN apk add --update --no-cache \ git \ @@ -8,11 +10,26 @@ RUN apk add --update --no-cache \ openldap-dev \ python3-dev \ libpq-dev \ + libjpeg \ + libmemcached-dev \ + libxml2-dev \ + libxslt-dev \ + zlib \ + jpeg-dev \ + zlib-dev \ && rm -rf /var/cache/apk/* # FIX https://github.com/python-ldap/python-ldap/issues/432 RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so -COPY requirements.txt ./ +#RUN LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "pip install --no-cache-dir -r requirements.txt" + +RUN pip install --upgrade pip + +#RUN CFLAGS="-Wno-cpp -Wno-unused-function -Wno-unused-variable -Wno-missing-noreturn -I/usr/include/libxml2" pip install lxml + RUN pip install --no-cache-dir -r requirements.txt -COPY ./ . + +EXPOSE 8000 + +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] diff --git a/requirements.txt b/requirements.txt index fd20c92e..12672c3d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -64,11 +64,11 @@ djangocms-video==1.0.0 easy-thumbnails==2.3 html5lib==0.9999999 ldap3==2.6.1 -lxml==3.6.0 +lxml model-mommy==1.2.6 phonenumbers==7.4.0 phonenumberslite==7.4.0 -psycopg2==2.7.3.2 +psycopg2==2.8.4 pycryptodome==3.6.6 pylibmc==1.5.1 python-dateutil==2.5.3 -- 2.45.2 From 179a2e63495ed63b27b192dfaaeaeb21b5e2428f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 23 May 2023 19:05:15 +0200 Subject: [PATCH 03/19] [gitignore] ignore venv/ --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2d923e99..41f41c20 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ media/ !media/keep /CACHE/ /static/ +/venv/ \#*# .\#* -- 2.45.2 From d60032c59a46bbc493ca977f5b72062d0d352f2a Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 23 May 2023 19:05:57 +0200 Subject: [PATCH 04/19] requirements: update some packages to newer versions Fixing a lot of pip install issues --- requirements.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 12672c3d..27308d8a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ Babel==2.3.4 Django==1.9.4 Django-Select2==4.3.2 -Pillow==3.2.0 +Pillow==9.5.0 URLObject==2.4.0 Unidecode==0.04.19 YURL==0.13 @@ -39,7 +39,7 @@ django-phonenumber-field==1.1.0 django-polymorphic==0.8.1 django-reversion==1.10.2 django-sekizai==0.9.0 -django-sortedm2m==1.2.2 +django-sortedm2m==3.1.1 django-spurl==0.6.4 django-standard-form==1.1.1 django-stored-messages==1.4.0 @@ -66,11 +66,10 @@ html5lib==0.9999999 ldap3==2.6.1 lxml model-mommy==1.2.6 -phonenumbers==7.4.0 -phonenumberslite==7.4.0 +phonenumbers==8.13.11 psycopg2==2.8.4 pycryptodome==3.6.6 -pylibmc==1.5.1 +pylibmc==1.6.3 python-dateutil==2.5.3 python-slugify==1.2.0 pytz==2016.4 @@ -78,7 +77,7 @@ rcssmin==1.0.6 requests>=2.20 rjsmin==1.0.12 six==1.10.0 -sqlparse==0.1.19 +sqlparse==0.4.4 stripe==2.41.0 wheel==0.29.0 django-admin-honeypot==1.0.0 -- 2.45.2 From 23cd61ad5413769bd4ae51459059ad7b39a67c17 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 23 May 2023 19:20:44 +0200 Subject: [PATCH 05/19] requirements: upgrade celery (5.2.7) and friends Failing with: The conflict is caused by: The user requested Django==1.9.4 aldryn-boilerplates 0.7.4 depends on Django<1.9.999 and >=1.5 aldryn-categories 1.0.3 depends on django<1.10 and >=1.6 aldryn-newsblog 1.2.1 depends on Django<1.10 and >=1.6 aldryn-people 1.2.0 depends on Django<1.10 and >=1.6 aldryn-reversion 1.0.8 depends on Django<1.10 and >=1.6 aldryn-search 0.2.11 depends on Django>=1.4 cmsplugin-filer 1.0.1 depends on Django>=1.5 django-appdata 0.1.5 depends on Django>=1.4.10 django-classy-tags 0.7.2 depends on Django>1.3 django-cms 3.2.5 depends on Django<1.10 and >=1.6.9 django-debug-toolbar 1.4 depends on Django>=1.7 django-filer 1.2.0 depends on Django<1.9.999 and >=1.5 django-formtools 1.0 depends on Django>=1.7 django-guardian 1.4.4 depends on Django>=1.7 django-haystack 2.4.1 depends on Django django-model-utils 2.5 depends on Django>=1.4.2 django-mptt 0.8.4 depends on Django>=1.8 django-reversion 1.10.2 depends on django>=1.8 django-standard-form 1.1.1 depends on Django>=1.3 django-stored-messages 1.4.0 depends on Django>=1.8 django-taggit-templatetags 0.2.5 depends on django>=1.1 django-treebeard 4.0.1 depends on Django>=1.7 djangocms-picture 1.0.0 depends on django>=1.6 easy-thumbnails 2.3 depends on django>=1.4.2 model-mommy 1.2.6 depends on Django django-celery-results 2.5.1 depends on Django>=3.2.18 --- requirements.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 27308d8a..658662c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -72,7 +72,7 @@ pycryptodome==3.6.6 pylibmc==1.6.3 python-dateutil==2.5.3 python-slugify==1.2.0 -pytz==2016.4 +pytz>=2023.3 rcssmin==1.0.6 requests>=2.20 rjsmin==1.0.12 @@ -86,16 +86,16 @@ git+https://github.com/ungleich/python-oca.git#egg=oca djangorestframework==3.6.3 flake8==3.3.0 python-memcached==1.58 -celery==4.0.2 +celery==5.2.7 redis==2.10.5 -django-celery-results==1.0.1 -kombu==4.1.0 +django-celery-results>=2.5.1 +kombu>=5.2.3 mccabe==0.6.1 pycodestyle==2.3.1 pyflakes==1.5.0 -billiard==3.5.0.3 +billiard==3.6.4.0 amqp==2.2.1 -vine==1.1.4 +vine>=5.0.0 cdist==5.0.1 git+https://github.com/ungleich/djangocms-multisite.git#egg=djangocms_multisite pyotp -- 2.45.2 From 449b78c3ebd41043cada4af4cc3ecc3f07f8cd3c Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 23 May 2023 17:39:51 +0000 Subject: [PATCH 06/19] Remove django-celery-results and update amqp to >=5.0.9 New error: Traceback (most recent call last): File "/app/manage.py", line 10, in execute_from_command_line(sys.argv) File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 302, in execute settings.INSTALLED_APPS File "/usr/local/lib/python3.10/site-packages/django/conf/__init__.py", line 55, in __getattr__ self._setup(name) File "/usr/local/lib/python3.10/site-packages/django/conf/__init__.py", line 43, in _setup self._wrapped = Settings(settings_module) File "/usr/local/lib/python3.10/site-packages/django/conf/__init__.py", line 99, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 992, in _find_and_load_unlocked File "", line 241, in _call_with_frames_removed File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/app/dynamicweb/__init__.py", line 3, in from .celery import app as celery_app File "/app/dynamicweb/celery.py", line 7, in app = Celery('dynamicweb') File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 291, in __init__ self._fixups = [symbol_by_name(fixup)(self) for fixup in self.fixups] File "/usr/local/lib/python3.10/site-packages/celery/app/base.py", line 291, in self._fixups = [symbol_by_name(fixup)(self) for fixup in self.fixups] File "/usr/local/lib/python3.10/site-packages/celery/fixups/django.py", line 44, in fixup _verify_django_version(django) File "/usr/local/lib/python3.10/site-packages/celery/fixups/django.py", line 32, in _verify_django_version raise ImproperlyConfigured('Celery 5.x requires Django 1.11 or later.') celery.exceptions.ImproperlyConfigured: Celery 5.x requires Django 1.11 or later. --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 658662c1..83d37dc5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -88,13 +88,13 @@ flake8==3.3.0 python-memcached==1.58 celery==5.2.7 redis==2.10.5 -django-celery-results>=2.5.1 +#django-celery-results>=2.5.1 kombu>=5.2.3 mccabe==0.6.1 pycodestyle==2.3.1 pyflakes==1.5.0 billiard==3.6.4.0 -amqp==2.2.1 +amqp>=5.0.9 vine>=5.0.0 cdist==5.0.1 git+https://github.com/ungleich/djangocms-multisite.git#egg=djangocms_multisite -- 2.45.2 From fbeb18070bc7c78049321e3ab1db4d7c0a470e20 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 24 May 2023 01:42:06 +0000 Subject: [PATCH 07/19] Try with python 3.7 because Django 1.11 is supported by it --- Dockerfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e522f0d4..be6d9ad2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10.0-alpine3.15 +FROM python:3.7-alpine3.15 WORKDIR /app diff --git a/requirements.txt b/requirements.txt index 83d37dc5..44fb60f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Babel==2.3.4 -Django==1.9.4 +Django==1.11 Django-Select2==4.3.2 Pillow==9.5.0 URLObject==2.4.0 -- 2.45.2 From 792868dd64795640ab3adff2574d309dbf4c774f Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 24 May 2023 01:42:59 +0000 Subject: [PATCH 08/19] Remove aldryn dependencies We don't seem to be using it --- requirements.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index 44fb60f3..f850fb49 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,14 +6,14 @@ URLObject==2.4.0 Unidecode==0.04.19 YURL==0.13 aldryn-apphooks-config==0.2.7 -aldryn-boilerplates==0.7.4 -aldryn-categories==1.0.3 -aldryn-common==1.0.1 -aldryn-newsblog==1.2.1 -aldryn-people==1.2.0 -aldryn-reversion==1.0.8 -aldryn-search==0.2.11 -aldryn-translation-tools==0.2.1 +#aldryn-boilerplates==0.7.4 +#aldryn-categories==1.0.3 +#aldryn-common==1.0.1 +#aldryn-newsblog==1.2.1 +#aldryn-people==1.2.0 +#aldryn-reversion==1.0.8 +#aldryn-search==0.2.11 +#/aldryn-translation-tools==0.2.1 backport-collections==0.1 cmsplugin-filer==1.0.1 django-appconf==1.0.2 -- 2.45.2 From cfffc67f5530b3c6cfe8111d791750bb901f2b6d Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 24 May 2023 01:44:38 +0000 Subject: [PATCH 09/19] Update django-cms, django-filer, django-formtools, django-treebeard, djangocms-admin-style, celery, kombu, amqp, vine to suitable versions --- requirements.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index f850fb49..1cb8e436 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,14 +20,14 @@ django-appconf==1.0.2 django-appdata==0.1.5 django-bootstrap3==7.0.1 django-classy-tags==0.7.2 -django-cms==3.2.5 +django-cms==3.6.0 django-compressor==2.0 django-debug-toolbar==1.4 python-dotenv==0.10.3 django-extensions==1.6.7 -django-filer==1.2.0 +django-filer==1.7.0 django-filter==0.13.0 -django-formtools==1.0 +django-formtools>=2.1 django-guardian==1.4.4 django-haystack==2.4.1 django-meta==1.2 @@ -47,8 +47,8 @@ django-taggit==0.18.3 django-taggit-autosuggest==0.2.8 django-taggit-templatetags==0.2.5 django-templatetag-sugar==1.0 -django-treebeard==4.0.1 -djangocms-admin-style==1.1.1 +django-treebeard>=4.3 +djangocms-admin-style>=1.2 djangocms-apphook-setup==0.1.2 djangocms-blog==0.8.13 djangocms-file==1.0 @@ -86,16 +86,16 @@ git+https://github.com/ungleich/python-oca.git#egg=oca djangorestframework==3.6.3 flake8==3.3.0 python-memcached==1.58 -celery==5.2.7 +celery==4.4.7 redis==2.10.5 #django-celery-results>=2.5.1 -kombu>=5.2.3 +kombu>=4.6.10 mccabe==0.6.1 pycodestyle==2.3.1 pyflakes==1.5.0 billiard==3.6.4.0 -amqp>=5.0.9 -vine>=5.0.0 +amqp>=2.6.0 +vine==1.3.0 cdist==5.0.1 git+https://github.com/ungleich/djangocms-multisite.git#egg=djangocms_multisite pyotp -- 2.45.2 From 21816e488447de3bdbe0f2235ddb6d0cd94af9ca Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 27 May 2023 07:01:39 +0000 Subject: [PATCH 10/19] Prepare a venv --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index be6d9ad2..7152b788 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,12 @@ RUN echo 'INPUT ( libldap.so )' > /usr/lib/libldap_r.so #RUN LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "pip install --no-cache-dir -r requirements.txt" -RUN pip install --upgrade pip +# Create a virtual environment +RUN python3 -m venv /venv + +ENV PATH="/venv/bin:$PATH" + +RUN pip install --no-cache-dir --upgrade pip #RUN CFLAGS="-Wno-cpp -Wno-unused-function -Wno-unused-variable -Wno-missing-noreturn -I/usr/include/libxml2" pip install lxml -- 2.45.2 From fc6c4c22419b356eb75762cfc1a84c6425a7473d Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 27 May 2023 07:02:19 +0000 Subject: [PATCH 11/19] Comment out celery for the moment --- dynamicweb/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dynamicweb/__init__.py b/dynamicweb/__init__.py index 1a6c551d..ab570876 100644 --- a/dynamicweb/__init__.py +++ b/dynamicweb/__init__.py @@ -1,5 +1,5 @@ # This will make sure the app is always imported when # Django starts so that shared_task will use this app. -from .celery import app as celery_app - -__all__ = ['celery_app'] +#from .celery import app as celery_app +# +#__all__ = ['celery_app'] -- 2.45.2 From e1764736fc38c82217a08a3f1f8e90b842d397a5 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 27 May 2023 07:03:17 +0000 Subject: [PATCH 12/19] Update django to fix the error SyntaxError: Generator expression must be parenthesized alpine:~/dynamicweb# docker run -ti dynamicweb:latest Unhandled exception in thread started by .wrapper at 0x7fdc22767710> Traceback (most recent call last): File "/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 227, in wrapper fn(*args, **kwargs) File "/venv/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run autoreload.raise_last_exception() File "/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 250, in raise_last_exception six.reraise(*_exception) File "/venv/lib/python3.7/site-packages/django/utils/six.py", line 685, in reraise raise value.with_traceback(tb) File "/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 227, in wrapper fn(*args, **kwargs) File "/venv/lib/python3.7/site-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/venv/lib/python3.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/venv/lib/python3.7/site-packages/django/apps/config.py", line 94, in create module = import_module(entry) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/venv/lib/python3.7/site-packages/django/contrib/admin/__init__.py", line 4, in from django.contrib.admin.filters import ( File "/venv/lib/python3.7/site-packages/django/contrib/admin/filters.py", line 10, in from django.contrib.admin.options import IncorrectLookupParameters File "/venv/lib/python3.7/site-packages/django/contrib/admin/options.py", line 12, in from django.contrib.admin import helpers, widgets File "/venv/lib/python3.7/site-packages/django/contrib/admin/widgets.py", line 151 '%s=%s' % (k, v) for k, v in params.items(), ^ SyntaxError: Generator expression must be parenthesized --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1cb8e436..dd5021aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Babel==2.3.4 -Django==1.11 +Django==1.11.18 Django-Select2==4.3.2 Pillow==9.5.0 URLObject==2.4.0 -- 2.45.2 From 56cae7b8ab31e7589accfd303d8d4229947b6abd Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 27 May 2023 08:43:22 +0000 Subject: [PATCH 13/19] Update more dependencies; fails at no module django_celery_results --- dynamicweb/settings/base.py | 2 +- requirements.txt | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 62fe2897..5f3938d4 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -113,7 +113,7 @@ INSTALLED_APPS = ( 'aldryn_common', 'aldryn_newsblog', 'aldryn_people', - 'aldryn_reversion', + #'aldryn_reversion', 'aldryn_translation_tools', 'treebeard', # utilities for implementing a tree 'sekizai', # for javascript and css management diff --git a/requirements.txt b/requirements.txt index dd5021aa..707309ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,21 +3,21 @@ Django==1.11.18 Django-Select2==4.3.2 Pillow==9.5.0 URLObject==2.4.0 -Unidecode==0.04.19 +Unidecode==1.0.23 YURL==0.13 -aldryn-apphooks-config==0.2.7 +#aldryn-apphooks-config==0.2.7 #aldryn-boilerplates==0.7.4 -#aldryn-categories==1.0.3 -#aldryn-common==1.0.1 -#aldryn-newsblog==1.2.1 -#aldryn-people==1.2.0 +aldryn-categories==1.2.0 +aldryn-common==1.0.5 +aldryn-newsblog==2.2.1 +aldryn-people==2.2.0 #aldryn-reversion==1.0.8 -#aldryn-search==0.2.11 -#/aldryn-translation-tools==0.2.1 +aldryn-search==0.2.11 +aldryn-translation-tools==0.3.0 backport-collections==0.1 cmsplugin-filer==1.0.1 django-appconf==1.0.2 -django-appdata==0.1.5 +django-appdata==0.2.1 django-bootstrap3==7.0.1 django-classy-tags==0.7.2 django-cms==3.6.0 @@ -34,7 +34,7 @@ django-meta==1.2 django-meta-mixin==0.3.0 django-model-utils==2.5 django-mptt==0.8.4 -django-parler==1.6.3 +django-parler==1.9.2 django-phonenumber-field==1.1.0 django-polymorphic==0.8.1 django-reversion==1.10.2 @@ -43,7 +43,7 @@ django-sortedm2m==3.1.1 django-spurl==0.6.4 django-standard-form==1.1.1 django-stored-messages==1.4.0 -django-taggit==0.18.3 +django-taggit==0.23.0 django-taggit-autosuggest==0.2.8 django-taggit-templatetags==0.2.5 django-templatetag-sugar==1.0 @@ -59,10 +59,10 @@ djangocms-link==1.7.2 djangocms-page-meta==0.5.11 djangocms-picture==1.0.0 djangocms-teaser==0.2.0 -djangocms-text-ckeditor==2.9.3 +djangocms-text-ckeditor==3.7.0 djangocms-video==1.0.0 easy-thumbnails==2.3 -html5lib==0.9999999 +html5lib==0.999999999 ldap3==2.6.1 lxml model-mommy==1.2.6 @@ -71,7 +71,7 @@ psycopg2==2.8.4 pycryptodome==3.6.6 pylibmc==1.6.3 python-dateutil==2.5.3 -python-slugify==1.2.0 +python-slugify==1.2.6 pytz>=2023.3 rcssmin==1.0.6 requests>=2.20 -- 2.45.2 From 934c1f98dec49d7b5021922878ce82e848d18297 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 29 May 2023 11:53:51 +0000 Subject: [PATCH 14/19] Updates : stalled with celery alpine:~/dynamicweb# docker run -ti dynamicweb:latest Unhandled exception in thread started by .wrapper at 0x7f9ede435cb0> Traceback (most recent call last): File "/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 228, in wrapper fn(*args, **kwargs) File "/venv/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 116, in inner_run autoreload.raise_last_exception() File "/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 251, in raise_last_exception six.reraise(*_exception) File "/venv/lib/python3.7/site-packages/django/utils/six.py", line 685, in reraise raise value.with_traceback(tb) File "/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 228, in wrapper fn(*args, **kwargs) File "/venv/lib/python3.7/site-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/venv/lib/python3.7/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models() File "/venv/lib/python3.7/site-packages/django/apps/config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/app/opennebula_api/models.py", line 11, in from utils.tasks import save_ssh_key, save_ssh_key_error_handler File "/app/utils/tasks.py", line 5, in from celery.result import AsyncResult File "/venv/lib/python3.7/site-packages/celery/result.py", line 14, in from . import current_app, states ImportError: cannot import name 'current_app' from 'celery' (/venv/lib/python3.7/site-packages/celery/__init__.py) --- dynamicweb/settings/base.py | 2 +- dynamicweb/settings/local.py | 2 +- requirements.txt | 19 ++++++++++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 5f3938d4..821e1e0c 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -156,7 +156,7 @@ INSTALLED_APPS = ( 'webhook', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'utils.middleware.MultipleProxyMiddleware', 'django.middleware.common.CommonMiddleware', diff --git a/dynamicweb/settings/local.py b/dynamicweb/settings/local.py index 4ea3dc7e..9f38f87d 100644 --- a/dynamicweb/settings/local.py +++ b/dynamicweb/settings/local.py @@ -15,7 +15,7 @@ CACHES = { } } -MIDDLEWARE_CLASSES += ("debug_toolbar.middleware.DebugToolbarMiddleware",) +MIDDLEWARE += ("debug_toolbar.middleware.DebugToolbarMiddleware",) INSTALLED_APPS += ( 'django_extensions', diff --git a/requirements.txt b/requirements.txt index 707309ef..9fbaf5e6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +setuptools<58.0.0 Babel==2.3.4 Django==1.11.18 Django-Select2==4.3.2 @@ -15,7 +16,7 @@ aldryn-people==2.2.0 aldryn-search==0.2.11 aldryn-translation-tools==0.3.0 backport-collections==0.1 -cmsplugin-filer==1.0.1 +#cmsplugin-filer==1.1.3 django-appconf==1.0.2 django-appdata==0.2.1 django-bootstrap3==7.0.1 @@ -25,18 +26,18 @@ django-compressor==2.0 django-debug-toolbar==1.4 python-dotenv==0.10.3 django-extensions==1.6.7 -django-filer==1.7.0 +django-filer==1.5.0 django-filter==0.13.0 -django-formtools>=2.1 +django-formtools==2.1 django-guardian==1.4.4 django-haystack==2.4.1 django-meta==1.2 django-meta-mixin==0.3.0 django-model-utils==2.5 -django-mptt==0.8.4 +django-mptt==0.11 django-parler==1.9.2 django-phonenumber-field==1.1.0 -django-polymorphic==0.8.1 +django-polymorphic==2.0.2 django-reversion==1.10.2 django-sekizai==0.9.0 django-sortedm2m==3.1.1 @@ -47,7 +48,7 @@ django-taggit==0.23.0 django-taggit-autosuggest==0.2.8 django-taggit-templatetags==0.2.5 django-templatetag-sugar==1.0 -django-treebeard>=4.3 +django-treebeard==4.3 djangocms-admin-style>=1.2 djangocms-apphook-setup==0.1.2 djangocms-blog==0.8.13 @@ -61,14 +62,14 @@ djangocms-picture==1.0.0 djangocms-teaser==0.2.0 djangocms-text-ckeditor==3.7.0 djangocms-video==1.0.0 -easy-thumbnails==2.3 +easy-thumbnails==2.4.1 html5lib==0.999999999 ldap3==2.6.1 lxml model-mommy==1.2.6 phonenumbers==8.13.11 psycopg2==2.8.4 -pycryptodome==3.6.6 +pycryptodome==3.8.0 pylibmc==1.6.3 python-dateutil==2.5.3 python-slugify==1.2.6 @@ -88,7 +89,7 @@ flake8==3.3.0 python-memcached==1.58 celery==4.4.7 redis==2.10.5 -#django-celery-results>=2.5.1 +django-celery-results==1.0.2 kombu>=4.6.10 mccabe==0.6.1 pycodestyle==2.3.1 -- 2.45.2 From 10c3c2381cd948d87a8707a5cd4c5e5cf4dd0943 Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 30 May 2023 03:55:09 +0000 Subject: [PATCH 15/19] Update Dockerfile --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7152b788..bd4bcd21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,10 @@ RUN pip install --no-cache-dir --upgrade pip RUN pip install --no-cache-dir -r requirements.txt -EXPOSE 8000 +# Copy entrypoint.sh script and grant execute permissions +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +# Run migrations and start the server +ENTRYPOINT ["/entrypoint.sh"] -CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] -- 2.45.2 From c52dff2c1037fe553cbbeda96f9ffb28637070be Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 30 May 2023 03:56:46 +0000 Subject: [PATCH 16/19] Rename celery.py to pr_celery => causing conflict in names --- datacenterlight/tasks.py | 2 +- dynamicweb/{celery.py => pr_celery.py} | 0 entrypoint.sh | 15 +++++++++++++++ utils/tasks.py | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) rename dynamicweb/{celery.py => pr_celery.py} (100%) create mode 100644 entrypoint.sh diff --git a/datacenterlight/tasks.py b/datacenterlight/tasks.py index 899b506f..c9613ee8 100644 --- a/datacenterlight/tasks.py +++ b/datacenterlight/tasks.py @@ -9,7 +9,7 @@ from django.core.urlresolvers import reverse from django.utils import translation from django.utils.translation import ugettext_lazy as _ -from dynamicweb.celery import app +from dynamicweb.pr_celery import app from hosting.models import HostingOrder from membership.models import CustomUser from opennebula_api.models import OpenNebulaManager diff --git a/dynamicweb/celery.py b/dynamicweb/pr_celery.py similarity index 100% rename from dynamicweb/celery.py rename to dynamicweb/pr_celery.py diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 00000000..f546bbea --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Wait for the database to be available +while ! nc -z db 5432; do + sleep 0.1 +done + +# Apply database migrations +python manage.py migrate + +# Collect static files +python manage.py collectstatic --no-input + +# Start the server +python manage.py runserver 0.0.0.0:8000 diff --git a/utils/tasks.py b/utils/tasks.py index 23deac51..2ae86916 100644 --- a/utils/tasks.py +++ b/utils/tasks.py @@ -8,7 +8,7 @@ from celery.utils.log import get_task_logger from django.conf import settings from django.core.mail import EmailMessage -from dynamicweb.celery import app +from dynamicweb.pr_celery import app logger = get_task_logger(__name__) -- 2.45.2 From 2679c2ddd58f9a7df157c638e72d7ba92e06d169 Mon Sep 17 00:00:00 2001 From: PCoder Date: Tue, 30 May 2023 03:57:13 +0000 Subject: [PATCH 17/19] Add missing importlib_metadata dependency --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 9fbaf5e6..7fdaf6f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -100,3 +100,4 @@ vine==1.3.0 cdist==5.0.1 git+https://github.com/ungleich/djangocms-multisite.git#egg=djangocms_multisite pyotp +importlib_metadata<5 -- 2.45.2 From 61d41a2879073aa33d07b7167e51201515fab1f3 Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 31 Jul 2023 05:11:05 +0000 Subject: [PATCH 18/19] Add docker-compose.yml --- docker-compose.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..29365eb7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,38 @@ +version: '3.8' + +services: + web: + build: + context: ./ + dockerfile: Dockerfile + command: gunicorn dynamicweb.wsgi:application --bind [::]:8000 + volumes: + - static_volume:/data/app/app/static + - media_volume:/data/app/app/media + expose: + - 8000 + env_file: + - ./.env + depends_on: + - db + db: + image: postgres:13.0-alpine + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql + - postgres_data:/data/var/lib/postgresql/data/ + env_file: + - ./.env + nginx: + build: ./nginx + volumes: + - static_volume:/data/app/app/static + - media_volume:/data/app/app/media + ports: + - 1337:80 + depends_on: + - web + +volumes: + postgres_data: + static_volume: + media_volume: -- 2.45.2 From 50e47d59613fd8eda11d69989bb86f867b163d4b Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 31 Jul 2023 08:30:24 +0000 Subject: [PATCH 19/19] Changes to get the server up and running --- docker-compose.yml | 44 ++++++++++++++++++++----------------- dynamicweb/settings/base.py | 8 +++++-- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 29365eb7..a8000ac5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,38 +1,42 @@ -version: '3.8' +version: '3' services: + # Django app service web: build: - context: ./ + context: . dockerfile: Dockerfile - command: gunicorn dynamicweb.wsgi:application --bind [::]:8000 + container_name: dynamicweb + command: python manage.py runserver 0.0.0.0:8000 volumes: - - static_volume:/data/app/app/static - - media_volume:/data/app/app/media - expose: - - 8000 - env_file: - - ./.env + - .:/app + ports: + - "8000:8000" depends_on: - db + + # PostgreSQL database service db: - image: postgres:13.0-alpine + image: postgres:13 + container_name: my_postgres_db + environment: + POSTGRES_USER: your_postgres_username + POSTGRES_PASSWORD: your_postgres_password + POSTGRES_DB: your_database_name volumes: - - ./init.sql:/docker-entrypoint-initdb.d/init.sql - - postgres_data:/data/var/lib/postgresql/data/ - env_file: - - ./.env + - postgres_data:/var/lib/postgresql/data + + # Nginx service nginx: - build: ./nginx + image: nginx:latest + container_name: my_nginx_server volumes: - - static_volume:/data/app/app/static - - media_volume:/data/app/app/media + - ./nginx/default.conf:/etc/nginx/conf.d/default.conf ports: - - 1337:80 + - "80:80" depends_on: - web volumes: postgres_data: - static_volume: - media_volume: + diff --git a/dynamicweb/settings/base.py b/dynamicweb/settings/base.py index 821e1e0c..5d5af9a3 100644 --- a/dynamicweb/settings/base.py +++ b/dynamicweb/settings/base.py @@ -239,8 +239,12 @@ CMS_TEMPLATES = ( DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'app', + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': 'your_database_name', + 'USER': 'your_postgres_username', + 'PASSWORD': 'your_postgres_password', + 'HOST': 'db', + 'PORT': '5432' } } -- 2.45.2