Trying to edit Advanced page settings returns a template error

I have a fresh installation of Djang CMS. I only added the djangocms-blog so far. When I try to edit the advanced page settings of any setting, I get the following template error.

__str__ returned non-string (type __proxy__)
Request Method:	GET
Request URL:	http://127.0.0.1:8000/admin/cms/page/42/advanced-settings/
Django Version:	3.1.4
Exception Type:	TypeError
Exception Value:	
__str__ returned non-string (type __proxy__)
Exception Location:	C:\users\dev\Projekte\swj\swj_venv\lib\site-packages\django\template\base.py, line 973, in render_value_in_context
Python Executable:	C:\users\dev\Projekte\swj\swj_venv\Scripts\python.exe
Python Version:	3.9.0
Python Path:	
['C:\\users\\dev\\Projekte\\swj\\swj_website',
 'C:\\Program Files\\Python39\\python39.zip',
 'C:\\Program Files\\Python39\\DLLs',
 'C:\\Program Files\\Python39\\lib',
 'C:\\Program Files\\Python39',
 'C:\\users\\dev\\Projekte\\swj\\swj_venv',
 'C:\\users\\dev\\Projekte\\swj\\swj_venv\\lib\\site-packages']
Server time:	Sun, 06 Dec 2020 00:29:33 +0100
Error during template rendering
In template C:\users\dev\Projekte\swj\swj_venv\lib\site-packages\django\forms\templates\django\forms\widgets\select_option.html, error at line 1

__str__ returned non-string (type __proxy__)
1	<option value="{{ widget.value|stringformat:'s' }}"{% include "django/forms/widgets/attrs.html" %}>{{ widget.label }}</option>
2	

I have tried cms check, and it tells me that my installation is fine. I have also tried fix-tree.

@Spiff You appear to be using Python 3.9, this is not yet supported by the project: https://github.com/django-cms/django-cms/blob/develop/setup.py#L29

Are you able to try using python 3.8? I suspect you have found limitations with Python 3.9.

A quick way to load your project using Python 3.9 is to use pyenv to be able to load in different versions of Python: https://github.com/pyenv-win

To help speed up creating a new environment (maybe you already know this) you can run “pip freeze > requirements.txt”, this will list all of your current installed packages and save them to the requirements.in file. To reuse the file in your new Python 3.8 virtual environment you can run “pip install -r requirements.in”

Can you also please post which django CMS version you are using. I can see the following:

  • Python 3.9
  • Django 3.1.4
  • django CMS ?

Hey,

by now I think that I caused this myself in some way. Let’s call teh project I was working on project A. Before I was working on project A I had already made a couple of test installations. In those I was able to get to the advanced settings. So I went throught the setup again und played around with the wizard options.
After reinstall, the cms seemed fine. I the installed djangocms-blog and still, everything was working. I do remember that in project A I had at some point deleted the home page. And I wonder if that broke something? Or maybe it was that I had PYthon 3.8 and Python 3.9 both installed. I’m working on a windows system and it seems that having more than one version of python installed is prone to cause conflicts.
Anyways, I grabbed the data from project A that I had already entered directly from the database, and now I have a new project where everything is running fine.

I am using:

  • Python 3.9
  • Django 3.1.4
  • Django CMS 3.8

It’s a bit disconcerning that I broke project A and to this point don’t really know how I did it. But so far, the new project is fine and Django CMS is a lot of fun to work with. On my last project I was forced to work on typo3 which is absolute horrific torture. It’s not actually possible to express in polite language just how horrible typo3 is. So I’ll leave it at this. :wink:

1 Like

That’s a good headline @Spiff for an article “Stop torturing yourself! Check out django CMS!” :wink: By the way, you are welcome to join us on Slack www.django-cms.org/slack