2trc / katika

6 stars 6 forks source link

Updatated code base to recent versions #28

Closed ntsieyo closed 1 year ago

ntsieyo commented 1 year ago

Here is the changes I made :

ntsieyo commented 1 year ago

Actually It would great to have a transitional branch, let call it trunk or whatever. In pull request will then be sent to this branch, so that you have a chance to test the new code and if you are happy with the changes you can then merge it in master.

2trc commented 1 year ago

Hi @ntsieyo and thank you so much for this massive contribution
It would have been great in the pull request was split into smaller PRs for a faster review (e.g. library upgrades vs nginx config...). Otherwise I'll look into ASAP but it'll take of time so please bear with me
Once again thanks a ton

ntsieyo commented 1 year ago

Yes, I understand, PRs was not planed at the beginning. I just want to run some tests and found myself fixing different kind of errors. So take your time and you can reach me if there are any questions regarding those changes

2trc commented 1 year ago

@ntsieyo I've spent some time on this yesterday and realized eg. Django4.2 requires to upgrade Python as well. I did that but got stuck with ModuleNotFoundError: No module named 'crispy_bootstrap3'
I knew such a big drop would take more time to check and I'd just like to let you know that I'm working on it whenever possible

2trc commented 1 year ago

Hi @ntsieyo As discussed I suggest breaking this PR in separate and independent ones
Hoping to see your subsequent contribution soon

GT-Codeur commented 1 year ago

Hello @ntsieyo and @cyrildzumts Please I need help with the installation. I upgrade the requirement.txt and I fixed other exceptions. Now I'm getting this error : `Traceback (most recent call last): File "/usr/lib/python3.10/logging/config.py", line 565, in configure handler = self.configure_handler(handlers[name]) File "/usr/lib/python3.10/logging/config.py", line 746, in configure_handler result = factory(**kwargs) File "/usr/lib/python3.10/logging/init.py", line 1169, in init StreamHandler.init(self, self._open()) File "/usr/lib/python3.10/logging/init.py", line 1201, in _open return open_func(self.baseFilename, self.mode, FileNotFoundError: [Errno 2] No such file or directory: '/home/germain/katika/logs/debug.log'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/germain/katika/manage.py", line 14, in execute_from_command_line(sys.argv) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/core/management/init.py", line 442, in execute_from_command_line utility.execute() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/core/management/init.py", line 416, in execute django.setup() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/init.py", line 19, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/log.py", line 76, in configure_logging logging_config_func(logging_settings) File "/usr/lib/python3.10/logging/config.py", line 810, in dictConfig dictConfigClass(config).configure() File "/usr/lib/python3.10/logging/config.py", line 572, in configure raise ValueError('Unable to configure handler ' ValueError: Unable to configure handler 'file' (venv) germain@germain-HP-ProBook-640-G1:~/katika$ python manage.py runserver Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(*self._args, self._kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper fn(*args, *kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run autoreload.raise_last_exception() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception raise _exception[1] File "/home/germain/katika/venv/lib/python3.10/site-packages/django/core/management/init.py", line 394, in execute autoreload.check_errors(django.setup)() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper fn(args, kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/init.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/apps/registry.py", line 91, in populate app_config = AppConfig.create(entry) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/apps/config.py", line 193, in create import_module(entry) File "/usr/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 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 "/home/germain/katika/venv/lib/python3.10/site-packages/mezzanine/conf/init.py", line 277, in module = import_module(app) File "/usr/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 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 "/home/germain/katika/venv/lib/python3.10/site-packages/mapwidgets/init.py", line 4, in from .widgets import GooglePointFieldWidget, GooglePointFieldInlineWidget, \ File "/home/germain/katika/venv/lib/python3.10/site-packages/mapwidgets/widgets.py", line 4, in from django.contrib.gis.forms import BaseGeometryWidget File "/home/germain/katika/venv/lib/python3.10/site-packages/django/contrib/gis/forms/init.py", line 3, in from .fields import ( # NOQA File "/home/germain/katika/venv/lib/python3.10/site-packages/django/contrib/gis/forms/fields.py", line 2, in from django.contrib.gis.gdal import GDALException File "/home/germain/katika/venv/lib/python3.10/site-packages/django/contrib/gis/gdal/init.py", line 28, in from django.contrib.gis.gdal.datasource import DataSource File "/home/germain/katika/venv/lib/python3.10/site-packages/django/contrib/gis/gdal/datasource.py", line 40, in from django.contrib.gis.gdal.driver import Driver File "/home/germain/katika/venv/lib/python3.10/site-packages/django/contrib/gis/gdal/driver.py", line 5, in from django.contrib.gis.gdal.prototypes import ds as vcapi File "/home/germain/katika/venv/lib/python3.10/site-packages/django/contrib/gis/gdal/prototypes/ds.py", line 9, in from django.contrib.gis.gdal.libgdal import lgdal File "/home/germain/katika/venv/lib/python3.10/site-packages/django/contrib/gis/gdal/libgdal.py", line 64, in raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal3.6.0", "gdal3.5.0", "gdal3.4.0", "gdal3.3.0", "gdal3.2.0", "gdal3.1.0", "gdal3.0.0", "gdal2.4.0", "gdal2.3.0", "gdal2.2.0"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings. ` _NB: I didn't create use vagrant I create a virtualenv and I install the requirements of the projects__

Kind regards.

ntsieyo commented 1 year ago

@GT-Codeur you have defines in your logging conf to write logs to home/germain/katika/logs/debug.log. But the path home/germain/katika/logs/ doesn't exist. You need to manually create that directory with : mkdir /home/germain/katika/logs After that restart again. The debug.log file will be created.

GT-Codeur commented 1 year ago

@ntsieyo Thanks for your prompt reaction. I will come back to you If I'm getting another issue.

ntsieyo commented 1 year ago

Tell me, are you working on my fork or you are on the upstream project ? Asking because on my fork I refactored the way the constants independent of code are provided, through it environment variable.

GT-Codeur commented 1 year ago

@ntsieyo Hello, Now I having this error: `Traceback (most recent call last): File "/home/germain/katika/venv/lib/python3.10/site-packages/pytz/lazy.py", line 3, in from UserDict import DictMixin ModuleNotFoundError: No module named 'UserDict'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/germain/katika/manage.py", line 7, in from mezzanine.utils.conf import real_project_name File "/home/germain/katika/venv/lib/python3.10/site-packages/mezzanine/utils/conf.py", line 11, in from mezzanine.utils.timezone import get_best_local_timezone File "/home/germain/katika/venv/lib/python3.10/site-packages/mezzanine/utils/timezone.py", line 4, in import pytz File "/home/germain/katika/venv/lib/python3.10/site-packages/pytz/init.py", line 32, in from pytz.lazy import LazyDict, LazyList, LazySet File "/home/germain/katika/venv/lib/python3.10/site-packages/pytz/lazy.py", line 5, in from collections import Mapping as DictMixin ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/init.py) `

GT-Codeur commented 1 year ago

Tell me, are you working on my fork or you are on the upstream project ? Asking because on my fork I refactored the way the constants independent of code are provided, through it environment variable.

I'm working on the upstream project. Ok I will fork yours and get back to you.

ntsieyo commented 1 year ago

You don't need to work on my fork since my changes was not accepted upstream. I have to break my changes in small PR. But I can find the time to do it. I asked if you were using my fork because I saw that you were using python 3.10

GT-Codeur commented 1 year ago

You don't need to work on my fork since my changes was not accepted upstream. I have to break my changes in small PR. But I can find the time to do it. I asked if you were using my fork because I saw that you were using python 3.10

Ok. I tried the formal installation but I got errors that's why I initiated the issue Error Installation. So I'm getting stuck.

ntsieyo commented 1 year ago

@GT-Codeur since you are on the upstream project, some Packages are no more available you won't be able to install old packages from the official pypi repository. Since you are using python 3.10, have a look at the requirements.txt located in my fork. I updated the package version so that they are compatible with python 3.10. Here for example , pytz need to be updated to : pytz==2023.3

GT-Codeur commented 1 year ago

Hello @ntsieyo Now I'm having this error and I'm still getting the same error after installing posgresql.

`System check identified 45 issues (0 silenced). Exception in thread django-main-thread: Traceback (most recent call last): File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection self.connect() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, *kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 270, in connect self.connection = self.get_new_connection(conn_params) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 112, in get_new_connection connection = super().get_new_connection(conn_params) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(args, kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 269, in get_new_connection connection = self.Database.connect(conn_params) File "/home/germain/katika/venv/lib/python3.10/site-packages/psycopg2/init.py", line 122, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket?

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(*self._args, self._kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper fn(*args, *kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/mezzanine/core/management/commands/runserver.py", line 170, in inner_run super().inner_run(args, kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 136, in inner_run self.check_migrations() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/core/management/base.py", line 574, in check_migrations executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS]) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 18, in init self.loader = MigrationLoader(self.connection) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 58, in init self.build_graph() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 235, in build_graph self.applied_migrations = recorder.applied_migrations() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 81, in applied_migrations if self.has_table(): File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/migrations/recorder.py", line 57, in has_table with self.connection.cursor() as cursor: File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 330, in cursor return self._cursor() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 306, in _cursor self.ensure_connection() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, *kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 288, in ensure_connection with self.wrap_database_errors: File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/utils.py", line 91, in exit raise dj_exc_value.with_traceback(traceback) from exc_value File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection self.connect() File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(args, kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 270, in connect self.connection = self.get_new_connection(conn_params) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 112, in get_new_connection connection = super().get_new_connection(conn_params) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner return func(*args, kwargs) File "/home/germain/katika/venv/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 269, in get_new_connection connection = self.Database.connect(conn_params) File "/home/germain/katika/venv/lib/python3.10/site-packages/psycopg2/init.py", line 122, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) django.db.utils.OperationalError: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket?`

ntsieyo commented 1 year ago

@GT-Codeur seems like you are not able to connect to your PostgreSQL server. I can assist you to get your setup running. We can arrange an appointment where we can have a look at it together.

GT-Codeur commented 1 year ago

@GT-Codeur seems like you are not able to connect to your PostgreSQL server. I can assist you to get your setup running. We can arrange an appointment where we can have a look at it together.

Thanks a lot. I'm available. In which platform are we going to communicate? I'm using teams what about you?

ntsieyo commented 1 year ago

@GT-Codeur seems like you are not able to connect to your PostgreSQL server. I can assist you to get your setup running. We can arrange an appointment where we can have a look at it together.

Thanks a lot. I'm available. In which platform are we going to communicate? I'm using teams what about you?

I'm using Teams on my work's laptop. I don't have teams on my private laptop but you can create a link in teams so that I can access it from the web.

ntsieyo commented 1 year ago

I don't use my work's laptop for my private stuff, send me a link at kiroo.cyrildz@gmail.com

GT-Codeur commented 1 year ago

kiroo.cyrildz@gmail.com

I just send it.

ntsieyo commented 1 year ago

@GT-Codeur one more for future contributors, can you confirm here that you were able to get the project running on your local environment ?

GT-Codeur commented 1 year ago

@ntsieyo Of course! By your help I was able to get the project running locally on my machine. Way to go @ntsieyo

GT-Codeur commented 1 year ago

@ntsieyo I succeed with stacticfiles configuration. Thanks once more for your help. Screenshot from 2023-07-21 04-19-04