-
Notifications
You must be signed in to change notification settings - Fork 104
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
Displaying external application listview and detailview #140
Comments
Hi, most things looks correct. But just so you know PAGE_EXTRA_CONTEXT is a setting so you should put that in your settings.py file otherwise this will not work. Alternatively you can subclass the CMS view and use you own instance of it which is probably the preferred and most flexible solution: https://github.com/batiste/django-page-cms/blob/master/pages/views.py#L168 Just sublass the Details class based view redefine the extra_context method and use an instance of it your urls.py. |
In my settings.py (project), I put below
Then again, browser shows below error
Do we have one complete example? As a newbie, working example would make more sense to me, if not all too troublesome. |
Well the error is obvious, extra_context doesn't exist within the context of your settings. Add your extra_context function inside your settings (with the necessary import inside the function itself). But this is quick and dirty solution. I strongly recommend you to subclass the Detail view. |
Trying out https://pythonhosted.org/django-page-cms/display-content.html#display-content-from-other-applications, but I got stuck.
If I have an app, called
news
with model ofNews
and want to display like belowand put below in the default template, for example
Put below in
news.views.py
In the browser, nothing is rendered. What am I missing? Normally I would tend to have models, admin(and/or forms), views, urls, templates.
The text was updated successfully, but these errors were encountered: