Skip to content

Compatibility with latest versions of django-cms and django #5

@ghost

Description

  • djangocms-spa-vue-js version: 0.1.24
  • Django version: 1.11.16
  • Python version: 3.6.5
  • Operating System: Mac OS 10.13.6

Description

I tried to start a project with Django 1.11 and different versions of Django CMS (3.5.x, 3.4.6, 3.4.5) without success. There was a wrong import in djangocms_spa.views (get_page_from_request wasn't in cms.utils.page_resolver anymore, now it is found in cms.utils.page) that i quickly fixed.

Unfortunately when I use the {% vue_js_router %} template tag I can only see a JSON object with the "routes" key set to an empty array.

	{
		"routes": [] 
	}

Digging up a bit, it appears that this is caused by a cache decorator wrapped around the _get_menu_renderer() function defined in cms.context_processors:

@lru_cache.lru_cache(maxsize=None)
def _get_menu_renderer():
    # We use lru_cache to avoid getting the manager
    # every time this function is called.
    from menus.menu_pool import menu_pool
    return menu_pool.get_renderer(request)

What I Did

If i comment the decorator the "routes" key in template seems to be properly set. Do you see any hazard in using this approach (avoiding the lru_cache usage)?

And, last but not least, are you thinking about mantaining this project in order to make it compatible with the latest versions of django and django-cms?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions