A recent system update prompted me to actually remove python3.9 .. which was used for my Django pages (including this one). An issue with a depreciated/removed feature in 3.10 made it needed to not just move from 3.9 -> 3.10 but also to upgrade packages.
Upgrading in-place was something I had tried before and it did not go well, so since my Mezzanine is pretty much vanilla I decided to just try to install the latest one and let it have a go at the DB. Worked a lot better than I had expected. Here's just a quick rundown for future reference (of myself and/or others):
So first save a list of installed packages in the current one with pip freeze
, then move the current install to a seperate folder and then start fresh:
python -mvenv myenv
source myenv/bin/activate
pip install mezzanine psycopg2
Anything else I only let it install as part of deps to try first, then I went on and created a new mezzanine project with the same name as before:
mezzanine-project lordvan
cd lordvan
cp old/lordvan/local_settings.py lordvan/local_settings.py
./manage.py migrate
As a pleasant surprise this just migrated everything out of the box without any issues whatsoever (keep in mind my mezzanine was real old already). Next a test with
./manage.py runserver <ip:port>
And it was just working. Of course what I had forgotten was that the Mezzanine start page, so next I just copied the new templates and edited them:
mkdir templates
cd templates
cp myenv/lib64/python3.10/site-packages/mezzanine/core/templates/base.html .
cp myenv/lib64/python3.10/site-packages/mezzanine/core/templates/index.html .
Now I had my page back up and running like before. Of course I forgot the usual again which caused a HTTP error in the browser:
cp old/lordvan/apache.wsgi lordvan/
chgrp apache lordvan -R
# edit apache config if you hardcoded the pythonpath there
/etc/init.d/apache2 restart
now it worked but there was no CSS/.. of course I also (again) forgot something else:
./manage.py collectstatic
and now we are up and running again .. except for one little thing: I had an error while saving this blog post .. (which caused me to type it again): unsupported operand type(s) for +: 'frozenset' and 'list'
After looking it up and checking the source I just edited the relevant mezzanine file (myenv/lib64/python3.10/site-packages/mezzanine/utils/html.py
) and changed line 113 to this:
protocols=list(ALLOWED_PROTOCOLS) + ["tel"],
now it runs without a problem. (there is also a bug https://github.com/stephenmcd/mezzanine/pull/2059 not sure about the 2nd part there . mine works as-is now so I'm going with that for now) - some people also simply downgraded Bleach to < 6.
Just for the record here the versions before and after:
Comments
There are currently no comments
New Comment