coop_cms is a Content Management System (CMS) for Django
========================================================
* `Yet another CMS ?`_
* `Quick start`_
.. _Yet another CMS?: #yacms
.. _Quick start?: #quick-start
.. _yacms:
Yet another CMS ?
------------------------------------
#. Coop-cms is built around Articles. It defines a basic abstract model so you can define your own model.
#. It has a website tree in a nice admin widget, to let you order Articles and *any other standard django model* you've defined in your project.
#. Based on the tree, you get templatetags for menu navigation, siblings links, breadcrumb, etc
Coop-cms has some sister apps to make it more usable:
* `coop_bar <https://github.com/ljean/coop-bar/>`_, an extensible toolbar (same concept : any app you create can add links in the toolbar).
* `coop_html_editor <https://github.com/ljean/coop_html_editor/>`_, integration of in-site html editors._
* `colorbox <https://github.com/ljean/coop-colorbox/>`_, make easy integration of jquery colorbox library.
.. _quick-start:
Quick start
-----------
Python 3, Django >=2.0, < 3.0 required
Install it with ``pip install apidev_coop_cms``
urls.py
~~~~~~~
At *the very end* of your urls.py file, add::
urlpatterns += [
url(r'^html-editor/', include('coop_html_editor.urls')),
url(r'^', include('coop_cms.urls')),
url(r'^coop_bar/', include('coop_bar.urls')),
]
Please note that coop-cms will handle any page slug, except the ones you will have defined before.
settings.py
~~~~~~~~~~~
In settings.py::
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'coop_cms.middleware.PermissionsMiddleware', # Optional: redirect to login when PermissionDenied is raised
'coop_cms.utils.RequestMiddleware',
...
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
'django.template.context_processors.request',
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.contrib.messages.context_processors.messages",
...
)
AUTHENTICATION_BACKENDS = (
'coop_cms.perms_backends.ArticlePermissionBackend',
'coop_cms.apps.email_auth.auth_backends.EmailAuthBackend', # Optional -> login with email rather than username
'django.contrib.auth.backends.ModelBackend', # Django's default auth backend
)
INSTALLED_APPS = (
# Contribs
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
# 3rd parties
'django_extensions',
'sorl.thumbnail',
'floppyforms',
'registration', # Optional
# apps
'coop_bar',
'coop_html_editor',
'colorbox',
'coop_cms',
'coop_cms.apps.coop_bootstrap', # Optional -> utilities for Bootstrap CSS framework
'coop_cms.apps.email_auth', # Optional -> login with email rather than username
# The coop_cms Article is an abstract model, you must define an Article in one of your app
# We provide 2 apps that can be used if needed. Choose one or the other
# 'coop_cms.apps.basic_cms', # Nothing else than a concrete Article model.
'coop_cms.apps.demo_cms', # A ready-to-use example app.
# The app below make possible to create articles from a RSS feed. Add it if needed
'coop_cms.apps.rss_sync',
)
# These are settings to customize the CMS behavior. The values are just examples and correspond to the demo_cms app.
# Define the Concrete Article to use. Not required if basic_cms is used
COOP_CMS_ARTICLE_CLASS = 'coop_cms.apps.demo_cms.models.Article'
# Define a custom form for Article editing. Not required if basic_cms is used
COOP_CMS_ARTICLE_FORM = 'coop_cms.apps.demo_cms.forms.ArticleForm'
# Make possible to customize the menus in the admin bar. Optional.
# If not defined, the tuple is build with the coop_bar_cfg modules of all INSTALLED_APPS
COOPBAR_MODULES = (
'coop_cms.apps.demo_cms.my_coop_bar',
)
# Populate the urls when editing <a> tag in HTML editor
COOP_HTML_EDITOR_LINK_MODELS = (
'demo_cms.Article',
)
# Optional: you can overload the aloha plugins used by coop_cms --> see coop_html_editor docs for details
ALOHA_PLUGINS = (
"common/format",
"common/highlighteditables",
)
# Optional: you can change the jquery version used by aloha --> see coop_html_editor docs for details
ALOHA_JQUERY = 'js/jquery.1.7.2.js'
# Optional : you can customize the whole behavior of aloha by proving the url of config file.
# It will overload the config provided by coop_html_editor --> see coop_html_editor for details
ALOHA_INIT_URL = '/static/js/my_aloha_config.js'
# Default size of the article logo. Can be changed in template
COOP_CMS_ARTICLE_LOGO_SIZE = "128x128"
# Templates that can be used for an article
# It can be a tuple or a function returning a tuple
COOP_CMS_ARTICLE_TEMPLATES = 'coop_cms.apps.demo_cms.get_article_templates'
# COOP_CMS_ARTICLE_TEMPLATES = (
# ('standard.html', 'Standard'),
# ('homepage.html', 'Homepage'),
# ('blog.html', 'Blog'),
# )
# Prefix for making absolute links
COOP_CMS_SITE_PREFIX = 'http://127.0.0.1:8000'
# from email : the domain of this address should allow the IP of your SMTP server : See SPF
COOP_CMS_FROM_EMAIL = '"Your name" <your@email.com>'
# TODO : REPLY-TO
COOP_CMS_REPLY_TO = '"Your name" <your@email.com>'
# Email address to send a newsletter test
COOP_CMS_TEST_EMAILS = (
'"Your name" <your@email.com>',
)
# tuples of templates that can be used for a newsletter.
COOP_CMS_NEWSLETTER_TEMPLATES = (
('basic_newsletter.html', 'Basic'),
('special_newsletter.html', 'With sections'),
('sortable_newsletter.html', 'Sortable sections'),
)
# optional : A custom form for editing the newsletter
COOP_CMS_NEWSLETTER_FORM = 'coop_cms.apps.demo_cms.forms.SortableNewsletterForm'
Base template
~~~~~~~~~~~~~
You need to create a base template ``base.html`` in one of your template folders. The ``article.html`` will inherit from this base template.
You need the following templatetags libs::
{% load coop_navigation coop_bar_tags %}
In the <head> of the document::
{% coop_bar_headers %}
{% block jquery_declaration %}{% endblock %}
{% block extra_head %}{% endblock %}
In the <body> of the document::
{% block document %}...{% endblock %}
{% coop_bar %}
Just before </body> at the end of the document::
{% coop_bar_footer %}
You can also put some navigations in the <body>::
{% navigation_as_nested_ul %}
The navigation_as_nested_ul templatetag accepts several args
* tree="english" --> The name of the navigation_tree to use. "default" if missing
* li_template="dropdown_li.html" --> a template for every <li> tags
* ul_template="dropdown_ul.html" --> a template for every <ul> tags
* li_args="dropdown_li_class.html" --> args to be used for any <li> tags
There are others templatetags for navigation : ``navigation_breadcrumb``, ``navigation_children``, ``navigation_siblings`` with similar behavior
Navigation configuration
~~~~~~~~~~~~~~~~~~~~~~~~
Don't forget to register the navigable types. In order to be accessible from the navigation, Model classes must be registered.
* In the django admin, go to coop_cms - Navigable types
* Add a new object and choose the model class you want to make accessible in navigation
* Define how to get the label in navigation for a given object : use the __unicode__, use the search field or use a custom get_label method
* If search_field is choosed, define the name of this field.
* The search field make possible to define which field to use when the navigation tree ask for matching objects.
* Then Go to a Navigation object in admin, the admin page propose to configure it thanks to a tree view
* Type some text in the text field at the top
* The field autocomplete propose all the objects of a NavigableType matching the text you entered
* Select one object and click 'Add a new item'
* The object is now part of the current navigation
Going further
-------------
You can look at the demo_app in apps folder to see how to customize the behavior of coop_cms:
* Editable "pieces of HTML" in your page : A editable block that can be shared by several pages.
* Custom templates for articles and newsletters
* Custom fields in article
* Custom admin bar
* Configuration values
Internationalization
--------------------
If you want to make an international site, coop_cms works well with `django-modeltranslation`.
We recommend to remove `django-modeltranslation` from the apps when making the model migrations
if not (len(sys.argv) > 1 and sys.argv[1] in ('makemigrations', )):
INSTALLED_APPS = ('modeltranslation', ) + INSTALLED_APPS
The model migrations wil not take the translation fields into account and it will be easier to add or remove languages
with the following commands
python manage.py sync_translation_fields --noinput
python manage.py update_translation_fields
License
=======
apidev-coop-cms is a fork of credis/coop_cms and uses BSD license see license.txt.
coop-cms development was funded by `CREDIS <http://credis.org/>`_, FSE (European Social Fund) and Conseil Regional d'Auvergne.
Raw data
{
"_id": null,
"home_page": "https://github.com/ljean/coop_cms/",
"name": "apidev-coop-cms",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Luc Jean",
"author_email": "ljean@apidev.fr",
"download_url": "https://files.pythonhosted.org/packages/af/f2/743cbcdd6881c4a0700a63d46a7ea427da38512c91f0a6e195d2b8f345bc/apidev_coop_cms-1.6.10.tar.gz",
"platform": null,
"description": "coop_cms is a Content Management System (CMS) for Django\n========================================================\n\n* `Yet another CMS ?`_\n* `Quick start`_\n\n.. _Yet another CMS?: #yacms\n.. _Quick start?: #quick-start\n\n\n.. _yacms:\n\nYet another CMS ?\n------------------------------------\n\n#. Coop-cms is built around Articles. It defines a basic abstract model so you can define your own model.\n#. It has a website tree in a nice admin widget, to let you order Articles and *any other standard django model* you've defined in your project.\n#. Based on the tree, you get templatetags for menu navigation, siblings links, breadcrumb, etc\n\nCoop-cms has some sister apps to make it more usable:\n\n* `coop_bar <https://github.com/ljean/coop-bar/>`_, an extensible toolbar (same concept : any app you create can add links in the toolbar).\n* `coop_html_editor <https://github.com/ljean/coop_html_editor/>`_, integration of in-site html editors._\n* `colorbox <https://github.com/ljean/coop-colorbox/>`_, make easy integration of jquery colorbox library.\n\n.. _quick-start:\n\nQuick start\n-----------\n\nPython 3, Django >=2.0, < 3.0 required\n\nInstall it with ``pip install apidev_coop_cms``\n\nurls.py\n~~~~~~~\n\nAt *the very end* of your urls.py file, add::\n\n urlpatterns += [\n url(r'^html-editor/', include('coop_html_editor.urls')),\n url(r'^', include('coop_cms.urls')),\n url(r'^coop_bar/', include('coop_bar.urls')),\n ]\n\nPlease note that coop-cms will handle any page slug, except the ones you will have defined before.\n\nsettings.py\n~~~~~~~~~~~\nIn settings.py::\n\n MIDDLEWARE_CLASSES = (\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'django.middleware.common.CommonMiddleware',\n 'django.middleware.locale.LocaleMiddleware',\n 'django.middleware.csrf.CsrfViewMiddleware',\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',\n 'django.contrib.messages.middleware.MessageMiddleware',\n 'django.middleware.clickjacking.XFrameOptionsMiddleware',\n 'django.middleware.security.SecurityMiddleware',\n 'coop_cms.middleware.PermissionsMiddleware', # Optional: redirect to login when PermissionDenied is raised\n 'coop_cms.utils.RequestMiddleware',\n ...\n )\n\n TEMPLATE_CONTEXT_PROCESSORS = (\n \"django.contrib.auth.context_processors.auth\",\n \"django.template.context_processors.debug\",\n \"django.template.context_processors.i18n\",\n 'django.template.context_processors.request',\n \"django.template.context_processors.media\",\n \"django.template.context_processors.static\",\n \"django.contrib.messages.context_processors.messages\",\n ...\n )\n\n AUTHENTICATION_BACKENDS = (\n 'coop_cms.perms_backends.ArticlePermissionBackend',\n 'coop_cms.apps.email_auth.auth_backends.EmailAuthBackend', # Optional -> login with email rather than username\n 'django.contrib.auth.backends.ModelBackend', # Django's default auth backend\n )\n\n INSTALLED_APPS = (\n # Contribs\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.sites',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n 'django.contrib.admin',\n 'django.contrib.admindocs',\n\n # 3rd parties\n 'django_extensions',\n 'sorl.thumbnail',\n 'floppyforms',\n 'registration', # Optional\n\n # apps\n 'coop_bar',\n 'coop_html_editor',\n 'colorbox',\n 'coop_cms',\n 'coop_cms.apps.coop_bootstrap', # Optional -> utilities for Bootstrap CSS framework\n 'coop_cms.apps.email_auth', # Optional -> login with email rather than username\n\n # The coop_cms Article is an abstract model, you must define an Article in one of your app\n # We provide 2 apps that can be used if needed. Choose one or the other\n # 'coop_cms.apps.basic_cms', # Nothing else than a concrete Article model.\n 'coop_cms.apps.demo_cms', # A ready-to-use example app.\n\n # The app below make possible to create articles from a RSS feed. Add it if needed\n 'coop_cms.apps.rss_sync',\n )\n\n # These are settings to customize the CMS behavior. The values are just examples and correspond to the demo_cms app.\n\n # Define the Concrete Article to use. Not required if basic_cms is used\n COOP_CMS_ARTICLE_CLASS = 'coop_cms.apps.demo_cms.models.Article'\n\n # Define a custom form for Article editing. Not required if basic_cms is used\n COOP_CMS_ARTICLE_FORM = 'coop_cms.apps.demo_cms.forms.ArticleForm'\n\n # Make possible to customize the menus in the admin bar. Optional.\n # If not defined, the tuple is build with the coop_bar_cfg modules of all INSTALLED_APPS\n COOPBAR_MODULES = (\n 'coop_cms.apps.demo_cms.my_coop_bar',\n )\n\n # Populate the urls when editing <a> tag in HTML editor\n COOP_HTML_EDITOR_LINK_MODELS = (\n 'demo_cms.Article',\n )\n\n # Optional: you can overload the aloha plugins used by coop_cms --> see coop_html_editor docs for details\n ALOHA_PLUGINS = (\n \"common/format\",\n \"common/highlighteditables\",\n )\n\n # Optional: you can change the jquery version used by aloha --> see coop_html_editor docs for details\n ALOHA_JQUERY = 'js/jquery.1.7.2.js'\n\n # Optional : you can customize the whole behavior of aloha by proving the url of config file.\n # It will overload the config provided by coop_html_editor --> see coop_html_editor for details\n ALOHA_INIT_URL = '/static/js/my_aloha_config.js'\n\n # Default size of the article logo. Can be changed in template\n COOP_CMS_ARTICLE_LOGO_SIZE = \"128x128\"\n\n # Templates that can be used for an article\n # It can be a tuple or a function returning a tuple\n COOP_CMS_ARTICLE_TEMPLATES = 'coop_cms.apps.demo_cms.get_article_templates'\n # COOP_CMS_ARTICLE_TEMPLATES = (\n # ('standard.html', 'Standard'),\n # ('homepage.html', 'Homepage'),\n # ('blog.html', 'Blog'),\n # )\n\n # Prefix for making absolute links\n COOP_CMS_SITE_PREFIX = 'http://127.0.0.1:8000'\n\n # from email : the domain of this address should allow the IP of your SMTP server : See SPF\n COOP_CMS_FROM_EMAIL = '\"Your name\" <your@email.com>'\n\n # TODO : REPLY-TO\n COOP_CMS_REPLY_TO = '\"Your name\" <your@email.com>'\n\n # Email address to send a newsletter test\n COOP_CMS_TEST_EMAILS = (\n '\"Your name\" <your@email.com>',\n )\n\n # tuples of templates that can be used for a newsletter.\n COOP_CMS_NEWSLETTER_TEMPLATES = (\n ('basic_newsletter.html', 'Basic'),\n ('special_newsletter.html', 'With sections'),\n ('sortable_newsletter.html', 'Sortable sections'),\n )\n # optional : A custom form for editing the newsletter\n COOP_CMS_NEWSLETTER_FORM = 'coop_cms.apps.demo_cms.forms.SortableNewsletterForm'\n\nBase template\n~~~~~~~~~~~~~\nYou need to create a base template ``base.html`` in one of your template folders. The ``article.html`` will inherit from this base template.\n\nYou need the following templatetags libs::\n\n {% load coop_navigation coop_bar_tags %}\n\nIn the <head> of the document::\n\n {% coop_bar_headers %}\n {% block jquery_declaration %}{% endblock %}\n {% block extra_head %}{% endblock %}\n\nIn the <body> of the document::\n\n {% block document %}...{% endblock %}\n {% coop_bar %}\n\nJust before </body> at the end of the document::\n\n {% coop_bar_footer %}\n\nYou can also put some navigations in the <body>::\n\n {% navigation_as_nested_ul %}\n\nThe navigation_as_nested_ul templatetag accepts several args\n * tree=\"english\" --> The name of the navigation_tree to use. \"default\" if missing\n * li_template=\"dropdown_li.html\" --> a template for every <li> tags\n * ul_template=\"dropdown_ul.html\" --> a template for every <ul> tags\n * li_args=\"dropdown_li_class.html\" --> args to be used for any <li> tags\n\nThere are others templatetags for navigation : ``navigation_breadcrumb``, ``navigation_children``, ``navigation_siblings`` with similar behavior\n\nNavigation configuration\n~~~~~~~~~~~~~~~~~~~~~~~~\nDon't forget to register the navigable types. In order to be accessible from the navigation, Model classes must be registered.\n * In the django admin, go to coop_cms - Navigable types\n * Add a new object and choose the model class you want to make accessible in navigation\n * Define how to get the label in navigation for a given object : use the __unicode__, use the search field or use a custom get_label method\n * If search_field is choosed, define the name of this field.\n * The search field make possible to define which field to use when the navigation tree ask for matching objects.\n\n * Then Go to a Navigation object in admin, the admin page propose to configure it thanks to a tree view\n * Type some text in the text field at the top\n * The field autocomplete propose all the objects of a NavigableType matching the text you entered\n * Select one object and click 'Add a new item'\n * The object is now part of the current navigation\n\n\nGoing further\n-------------\n\nYou can look at the demo_app in apps folder to see how to customize the behavior of coop_cms:\n * Editable \"pieces of HTML\" in your page : A editable block that can be shared by several pages.\n * Custom templates for articles and newsletters\n * Custom fields in article\n * Custom admin bar\n * Configuration values\n \nInternationalization\n--------------------\n\nIf you want to make an international site, coop_cms works well with `django-modeltranslation`.\n\nWe recommend to remove `django-modeltranslation` from the apps when making the model migrations\n\n\n if not (len(sys.argv) > 1 and sys.argv[1] in ('makemigrations', )):\n INSTALLED_APPS = ('modeltranslation', ) + INSTALLED_APPS\n\nThe model migrations wil not take the translation fields into account and it will be easier to add or remove languages\nwith the following commands\n\n python manage.py sync_translation_fields --noinput\n python manage.py update_translation_fields\n\n\nLicense\n=======\n\napidev-coop-cms is a fork of credis/coop_cms and uses BSD license see license.txt.\n\ncoop-cms development was funded by `CREDIS <http://credis.org/>`_, FSE (European Social Fund) and Conseil Regional d'Auvergne.\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Small CMS built around a tree navigation open to any django models",
"version": "1.6.10",
"project_urls": {
"Download": "https://github.com/ljean/coop_cms/tarball/master",
"Homepage": "https://github.com/ljean/coop_cms/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6a3cdbbb0119d31a8507bc7b109bec62d72c2cc475afa30c577363b369ae721b",
"md5": "2178a1ef210c06ae1ef4ca1b84a100a2",
"sha256": "325023cc7920d92a0690c3c354a8068b02a24bd1591e56393aef51270b126f51"
},
"downloads": -1,
"filename": "apidev_coop_cms-1.6.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2178a1ef210c06ae1ef4ca1b84a100a2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 1286958,
"upload_time": "2024-12-13T14:29:52",
"upload_time_iso_8601": "2024-12-13T14:29:52.488950Z",
"url": "https://files.pythonhosted.org/packages/6a/3c/dbbb0119d31a8507bc7b109bec62d72c2cc475afa30c577363b369ae721b/apidev_coop_cms-1.6.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "aff2743cbcdd6881c4a0700a63d46a7ea427da38512c91f0a6e195d2b8f345bc",
"md5": "506123ad17dad05dfadcdea57bd25b34",
"sha256": "dd3299380393e91210d265e10834e2460db811a8190fc1f5f6cdcd090c2bdcb5"
},
"downloads": -1,
"filename": "apidev_coop_cms-1.6.10.tar.gz",
"has_sig": false,
"md5_digest": "506123ad17dad05dfadcdea57bd25b34",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 1045059,
"upload_time": "2024-12-13T14:30:02",
"upload_time_iso_8601": "2024-12-13T14:30:02.830706Z",
"url": "https://files.pythonhosted.org/packages/af/f2/743cbcdd6881c4a0700a63d46a7ea427da38512c91f0a6e195d2b8f345bc/apidev_coop_cms-1.6.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-13 14:30:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ljean",
"github_project": "coop_cms",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "apidev-coop-cms"
}