New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apphook urls/views ignored on multisite setup after upgrade to 3.5.2 #6526

Open
rfabes21 opened this Issue Sep 19, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@rfabes21

rfabes21 commented Sep 19, 2018

Summary

We had built a djangoCMS multisite set up that originally had 2 sites. We then had to add 5 more sites, and followed the DjCMS docs on site copying to set us up with duplicate placeholder sites that we could then edit the content for. Each site had 1 to 2 apphooks on individual pages.

After upgrading to 3.5.2 (from 3.4.4), we noticed odd behavior in 2 ways after deployment of the upgrade.

Any page that referenced an apphook page such as a url {% url "app_events:list" %} would throw a NoReverseMatch: 'app_events' is not a registered namespace exception. As well, navigating to said Apphook page would load a default view so the plugins in the static placeholder would show up, however the view in question inside the Apphook-App would never get called -- until that Apphook page was given a unique Application Instance Name, and published. All of this would then cease to function and revert back to errors if the project was deployed again and the server was restarted.

Expected behaviour

The apphook urls should be routed properly by the djangoCMS internal router so the app recognizes that an app exists with that particular namespace, and should persist through server restarts and deployments.

Actual behaviour

Any reference to an apphook via url will throw a NoReverseMatch exception, and the page with the apphook attached to it loads a default view which displays the plugins on the page, but the apphook view is never called.

Environment

apps.py:

class Config(AppConfig):
    name = "app.events"
    label = "app_events"
    verbose_name = "Events App"

    def ready(self):
        pass

cms_apps.py

@apphook_pool.register
class EventsApp(CMSApp):
    name = 'Events'
    app_name = apps.Config.label

    def get_urls(self, page=None, language=None, **kwargs):
        return ["app.events.urls"]
  • Python version: 3.6.6
  • Django version:
  • django CMS version: 3.5.2

@rfabes21 rfabes21 changed the title from Apphook urls/views ignored on multisite set up after upgrade to 3.5.2 to Apphook urls/views ignored on multisite setup after upgrade to 3.5.2 Sep 19, 2018

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