Skip to content

upgrade code to django 4.2.1 and python 3.8.10 (testing env versions)#46

Open
JulianDroske wants to merge 2 commits intoxiaohuanshu:masterfrom
JulianDroske:master
Open

upgrade code to django 4.2.1 and python 3.8.10 (testing env versions)#46
JulianDroske wants to merge 2 commits intoxiaohuanshu:masterfrom
JulianDroske:master

Conversation

@JulianDroske
Copy link
Copy Markdown

applied patches i commited before.

juliandroske added 2 commits May 5, 2023 21:49
django and Python have changed over the years. Many modules have been found vunlerable and need to be updated.
In order to improve the compatibility and safety without changing the codebase too much, i added /compatches.
For now, it works, temporarily.
this project is created using some very, very old softwares containing a huge amount of vulnerabilities and
thus cause many problems nowadays without upgrades. these patches make this system support higher version of
base environments and drop support for olds to fix it. testing env. are django 4.2.1 and python 3.8.10.
again, i have no idea on how to fully test it without database, so mark this commit as a "concept".
@xiaohuanshu
Copy link
Copy Markdown
Owner

Good job.I took a quick look at that, and I found a few problems.

  1. requirements.txt needs to be updated
  2. python manage.py check need to be handled
  3. In settings.py, "from checkinsystem.settings_env import *" is not good, you can use an environment variable to point to settings_env or settings_local if you want run some test. eg:
if os.getenv('LOCAL_SETTINGS', None):
    import importlib
    local_settings = os.getenv('LOCAL_SETTINGS')
    mdl = importlib.import_module("checkinsystem." + local_settings)
    if "__all__" in mdl.__dict__:
        names = mdl.__dict__["__all__"]
    else:
        names = [x for x in mdl.__dict__ if not x.startswith("_")]
    globals().update({k: getattr(mdl, k) for k in names})
elif os.path.exists(os.path.join(DIRNAME, "local_settings.py")):
    from checkinsystem.local_settings import *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants