Coder Social home page Coder Social logo

django-cms / django-cms Goto Github PK

View Code? Open in Web Editor NEW
9.9K 394.0 3.0K 103.1 MB

The easy-to-use and developer-friendly enterprise CMS powered by Django

Home Page: http://www.django-cms.org

License: BSD 3-Clause "New" or "Revised" License

Python 60.04% JavaScript 30.67% HTML 4.99% Shell 0.54% SCSS 3.76%
python django django-cms cms web hacktoberfest

django-cms's Introduction

django CMS

image

image

image

Code Climate

Open source enterprise content management system based on the Django framework and backed by the non-profit django CMS Association (Sponsor us!).

Contribute to this project and win rewards

Because django CMS is a community-driven project, we welcome everyone to get involved in the project and receive a reward for their contribution. Become part of a fantastic community and help us make django CMS the best open source CMS in the world.

Attention

Please use the develop branch as the target for pull requests for on-going development.

Security fixes will be backported to older branches by the core team as appropriate.

Features

  • hierarchical pages
  • extensive built-in support for multilingual websites
  • multi-site support
  • draft/publish workflows
  • version control
  • a sophisticated publishing architecture, that's also usable in your own applications
  • frontend content editing
  • a hierarchical content structure for nested plugins
  • an extensible navigation system that your own applications can hook into
  • SEO-friendly URLs
  • designed to integrate thoroughly into other applications

Developing applications that integrate with and take advantage of django CMS features is easy and well-documented.

More information on our website.

Requirements

See the Python/Django requirements for the current release version in our documentation.

See the installation how-to guide for an overview of some other requirements and dependencies of the current release.

Getting started

These tutorials take you step-by-step through some key aspects of django CMS.

Documentation

Our documentation working group maintains documentation for several versions of the project. Key versions are:

  • stable (default), for the current release version
  • latest, representing the latest build of the release-3.4.x branch
  • develop, representing the latest build of the develop branch

For more information about our branch policy, see Branches.

Our documentation is hosted courtesy of Read the Docs.

The dependencies for the docs are compiled by pip-tools.

Test django CMS in our demo

The demo platform is kindly provided by Divio, platinum member of the django CMS Association.

Try demo with Divio Cloud

Getting Help

Please head over to our Slack channel or our discourse forum for support.

Professional support

Choose from a list of trusted tech partner of the django CMS Association to get your website project delivered successfully.

Choose a trusted web host for your django CMS project and get your website online today.

The django CMS Association

The django CMS Association is a non-profit organization that was founded in 2020 with the goal to drive the success of django CMS, by increasing customer happiness, market share and open-source contributions. We provide infrastructure and guidance for the django CMS project.

The non-profit django CMS Association is dependent on donations to fulfill its purpose. The best way to donate is to become a member of the association and pay membership fees. The funding will be funneled back into core development and community projects.

Join the django CMS Association.

Credits

django-cms's People

Contributors

adaptivelogic avatar aiky30 avatar andrewschoen avatar beniwohli avatar chive avatar chrisglass avatar czpython avatar dhorelik avatar digi604 avatar drmeers avatar evildmp avatar finalangel avatar fivethreeo avatar flashjunior avatar fsbraun avatar jezdez avatar jrief avatar jsma avatar kezabelle avatar lory87 avatar mkoistinen avatar nobeh avatar o-zander avatar ojii avatar pcicman avatar stefanfoulis avatar tanderegg avatar timgraham avatar vxsx avatar yakky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-cms's Issues

application_urls field is too short

The max_length for application_urls is only 32 character which is way too short for long module names or encapsulated modules (think Satchmo and other complex projects). The maximal path should be at least 200 characters long.

Delete plugin while being edited

1. Add plugin to page 2. start editing plugin 3. delete plugin on the left 4. click save to save changes to the plugin 5. observe 404 error

:) Doesn’t actually break anything, but would be confusing for a user.

Fix could close the editor?

Enabling CSRF Middleware breaks admin site

Enabling the CSRF Middleware breaks the following on the admin site:
- Published/In Navigation Checkboxes
- Cut/Paste (moving pages)
- Drag and drop (moving pages)

Because these post to the server, they need to include a token from the CSRF Middleware (if it is enabled). If they do not, the result is a 403 Forbidden.

Replace wymeditor

after some projects with wymeditor we came to the conclusion that wymeditor sucks!
We need a replacement for it.

Apphook on "home" page does not work

Example:

In my app, I specified the "Sample Application" to be available on my "Home" page, which is first in the tree.
If I hit "/" I do not see the {{ message }} output in the template.
If I hit "/home/" I do.

Plugin objects can't be edited after drag-and-drop in editor (Firefox)

In Firefox, if you drag an image that represents a plugin object around, and then press 'Edit selected object', you get a prompt saying "no object selected"

This apparently occurs because in Firefox events that have been attached to the image object are lost when the object is moved around like this. WymEditor relies on these events to know when an image has been selected, and the "edit selected object" button relies on WymEditor for this. This is essentially a browser bug.

I do have a patch for WymEditor that does fix it, by binding to the dragdrop event and running a function immediately afterwards to re-instate the event handlers. I don't know if we want to go down the road of patching WymEditor though.

text plugins not working

I have never been able to get plugins within Text working in CMS 2. I am currently using the latest version from github, with the master branch (though I've tried both textobjects and django1.1 branches also to no avail). I've tested it with Django r9505, 1.0.2, r9999, and latest trunk, but without success.

Under Django r9505 and 1.0.2, a DoesNotExist is raised when attempting to save the nested plugin: http://dpaste.com/hold/42866/

Under Django r9999 / latest trunk (if you apply the fix described in my previous email), the popup that appears refuses to close or report back to the main page. It just states that the new plugin was added successfully, and stays open for further editing. Closing it does not update the text object.

Does anyone have this working? Which versions/branches are you using?

Text objects

plugins should be able to be inserted into the text-plugins text (link, picture)

Plugin-tree

Plugins should be organized in a tree so more complex stuff can happen

Editing the Site object causes 404's

If the server is running and you change the name and/or address of the site object for the current site 404’s are returned.

Restarting the server seems to fix this.

Tested on the django dev server.

Plugin save button inconsistency

Some plugins have Save buttons in grey, on the left (file, image from image filer). Others are are blue, and on the right (text). This should be standardised for the user's sake.

Plugins within Text render twice!

Placeholder seems to merrily iterate through all plugins whilst rendering without checking whether some of them are actually embedded within others! For efficiency, it would probably be best to add an 'embedded' or 'nested' boolean field to the CMSPlugin class which can be set upon creation, however for now I have implemented a quick hack to get around it on my system:

diff --git a/cms/templatetags/cms_tags.py b/cms/templatetags/cms_tags.py
index afc34e2..22d2281 100644
--- a/cms/templatetags/cms_tags.py
+++ b/cms/templatetags/cms_tags.py
@@ -387,7 +387,18 @@ class PlaceholderNode(template.Node):
         else:
             plugins = CMSPlugin.objects.filter(page=page, language=l, placehold
             c = ""
+
+            nested_ids = []
+            from cms.plugins.text.utils import OBJ_ADMIN_RE
+            for plugin in plugins:
+                i = plugin.get_plugin_instance()[0]
+                if getattr(i, 'body', False):
+                    for m in OBJ_ADMIN_RE.findall(i.body):
+                        nested_ids.append(int(m))
+                        
             for plugin in plugins:
+                # check that it's not already nested
+                if plugin.id in nested_ids: continue
                 c += plugin.render_plugin(context, self.name)
         if not c:
             return ''

Do not show untranslated pages in the navigation

I think it's not good to show pages that do not have content in the currently selected language in the navigation. Some times people want to not publish all information in all languages.

I came up with a quick hack to accomplish this. I replaced lines 88 - 96 in templatetags/cms_tags.py with the following code:

    other_children = []
    for page in children:# add the title and slugs and some meta data
        for title in titles:
            if title.page_id == page.pk:
                page.title_cache = title
                other_children.append(page)
                #titles.remove(title)
        if page.pk in ancestors:
            page.ancestor = True
        if current_page and page.parent_id == current_page.parent_id and not page.pk == current_page.pk:
            page.sibling = True

and then provide other_children list in the context instead of children list:
context.update({'children':other_children,
'template':template,
'from_level':from_level,
'to_level':to_level,
'extra_inactive':extra_inactive,
'extra_active':extra_active})

I know this is a quick ugly hack, but I think it'd be a good thing to implement. Maybe as an attribute for the template tag?

Edit in place

it would be nice if you could edit content in place directly on the site

KeyError exception raised if slug field blank

If I create a page and leave the slug blank, the following exception is raised. Furthermore, the page

Environment:

Request Method: POST
Request URL: http://localhost:8000/admin/cms/page/1/?language=en&
Django Version: 1.1 beta 1 SVN-10755
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django_evolution',
 'django_extensions',
 'cms',
 'cms.plugins.text',
 'cms.plugins.picture',
 'cms.plugins.file',
 'mptt',
 'reversion']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.contrib.csrf.middleware.CsrfMiddleware',
 'cms.middleware.CurrentPageMiddleware')


Traceback:
File "/home/simon/.pythonpath/django/core/handlers/base.py" in get_response
  92.                 response = callback(request, *callback_args, **callback_kwargs)
File "/home/simon/.pythonpath/django/contrib/admin/sites.py" in root
  480.                 return self.model_page(request, *url.split('/', 2))
File "/home/simon/.pythonpath/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/home/simon/.pythonpath/django/contrib/admin/sites.py" in model_page
  499.         return admin_obj(request, rest_of_url)
File "/home/meers/.pythonpath/cms_versions/2/cms/admin/__init__.py" in __call__
  114.         return super(PageAdmin, self).__call__(request, url)
File "/home/simon/.pythonpath/reversion/admin.py" in __call__
  85.             return super(VersionAdmin, self).__call__(request, url)
File "/home/simon/.pythonpath/django/contrib/admin/options.py" in __call__
  1094.             return self.change_view(request, unquote(url))
File "/home/meers/.pythonpath/cms_versions/2/cms/admin/__init__.py" in change_view
  266.         return super(PageAdmin, self).change_view(request, object_id, extra_context)
File "/home/simon/.pythonpath/django/db/transaction.py" in _commit_on_success
  240.                 res = func(*args, **kw)
File "/home/simon/.pythonpath/reversion/revisions.py" in _create_on_success
  177.                     result = func(*args, **kwargs)
File "/home/simon/.pythonpath/django/db/transaction.py" in _commit_on_success
  240.                 res = func(*args, **kw)
File "/home/simon/.pythonpath/django/contrib/admin/options.py" in change_view
  812.             if form.is_valid():
File "/home/simon/.pythonpath/django/forms/forms.py" in is_valid
  120.         return self.is_bound and not bool(self.errors)
File "/home/simon/.pythonpath/django/forms/forms.py" in _get_errors
  111.             self.full_clean()
File "/home/simon/.pythonpath/django/forms/forms.py" in full_clean
  250.             self.cleaned_data = self.clean()
File "/home/meers/.pythonpath/cms_versions/2/cms/admin/forms.py" in clean
  29.         slug = cleaned_data['slug']

Exception Type: KeyError at /admin/cms/page/1/
Exception Value: 'slug'

Application hooks

applications with theire urls.py can be attached to a page. reverse and urls handling is then controlled by which page the application is connected to.

Plugin inheritance

there should be a way to inherit the plugins of parent pages or the other way around.

Django-multilingual and CMSPlugins don't like each other

It seems that multilingual thinks cmsplugin to be a translatable (by multilingual) model. It replaces the standard ModelAdmin with its own, and tests for multilingual compatibility followingly (in multilingual/utils.py):

def is_multilingual_model(model):
    """
    Return True if `model` is a multilingual model.
    """
    return hasattr(model._meta, 'translation_model')

Here is the full traceback I get in the plugins (all plugins) editing view:

Environment:

Request Method: GET
Request URL: http://viherio.freebsd/admin/cms/page/3/edit-plugin/14/
Django Version: 1.0.2 final
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.formtools',
 'django.contrib.syndication',
 'django.contrib.markup',
 'tinymce',
 'filebrowser',
 'journal',
 'comments',
 'tagging',
 'chunks',
 'multilingual',
 'cms',
 'cms.plugins.text',
 'cms.plugins.picture',
 'cms.plugins.link',
 'cms.plugins.file',
 'mptt']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'multilingual.middleware.DefaultLanguageMiddleware',
 'cms.middleware.CurrentPageMiddleware',
 'cms.middleware.MultilingualURLMiddleware')


Traceback:
File "/usr/local/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
  86.                 response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.5/site-packages/django/contrib/admin/sites.py" in root
  157.                 return self.model_page(request, *url.split('/', 2))
File "/usr/local/lib/python2.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.5/site-packages/django/contrib/admin/sites.py" in model_page
  176.         return admin_obj(request, rest_of_url)
File "/usr/local/www/django/lib/cms/admin/__init__.py" in __call__
  95.             return edit_plugin(request, plugin_id, self.admin_site)
File "/usr/local/www/django/lib/cms/admin/views.py" in edit_plugin
  89.         instance, admin = cms_plugin.get_plugin_instance(admin_site)
File "/usr/local/www/django/lib/cms/models/__init__.py" in get_plugin_instance
  441.         plugin = plugin_pool.get_plugin(self.plugin_type)(*args, **kwargs)

Exception Type: TypeError at /admin/cms/page/3/edit-plugin/14/
Exception Value: multilingual_modeladmin_new() takes at least 3 arguments (2 given)

redirects

There should be a possibility to setup redirects.
I would propose a new model called redirects... with a from_url and to_url and an optional page

Unique Slugs still being asked for when set to False.

I'm working with svn revision 289, so forgive me if this is fixed.

I've set; CMS_UNIQUE_SLUGS = False

Children from different parents can have the same slug. However, children cannot have slugs the same as their parent or another parent. in these cases the message about another page existing with the slug is shown.

So to demonstrate this with the generated URLs. This is ok;

parent1/slug-name/
parent2/slug-name/

this doesn't seem to be allowed;

parent1/slug-name/
parent2/parent1/

Apphook not working on a subpage

An app hooked into a page is only going to work on a main-level page, but not on a sub-level page.
-startsite (<= ok)
-information (<= ok)
--our blogs (<= not working)
There is no error message or any other output that might lead to a solution.

EDIT:
I just digged a bit into the code and it seems that the menuitem is generated the wrong way.
The page structure is:
-startsite
-informationen
--blogs

The generated "blogs"-menuitem is "blogs/" instead of "informationen/blogs/"... if I change the url to the right direction, than the app gets loaded.

Cross Domain Request Error

If you store the media on a different domain the rich text editor causes a JavaScript editor when it attempts to load the HTML file.

You can repeat this by doing the following. If the following config for the site/media; site_root – www.mydomain.com media_url – media.mydomain.com admin_media = admin.mydomain.com

Then when you go to the admin and add a text plugin, trying to edit will cause a JavaScript error a request is being made from www.mydomain.com to media.mydomain.com . This is a problem since cross domain requests are not allowed for security reasons. Change History (follow-up: ↓ 2 ) 03/30/09 13:28:32 changed by divio ¶

how does the normal admin handles this issue with the javascript files it loads? (in reply to: ↑ 1 ) 04/04/09 19:45:01 changed by guest ¶

Replying to divio:

how does the normal admin handles this issue with the javascript files it loads?

contrib.admin doesn’t user any Ajax so cross domain issues are not well an issue. 04/06/09 16:17:18 changed by divio ¶

how do you handle this if you use ajax anywhere on your site?

Plugin search API

at the moment only the text plugin is searched in the admin. A search api for other plugins is needed.

Translation Helpers / Plugin copy

It would be nice if you could copy the plugins from other languages and if you could see in the page view which languages still need translations

Improving the interface for content authors

Content authors are faced with two Save buttons: one for the content editor they are using, and one for the page as a whole.

It may help the content author if the content editor appeared in a new pop-up window for editing:

  • it would provide a stronger clue that they were editing a piece if content in its own right
  • it would make it easier to see more of the content at once
  • it would make the page editing window simpler

django 1.1 problem

Using the latest version of Django trunk, with or without the django1.1 branch of CMS 2 checked out, it is impossible to edit plugins. An AttributeError is raised ('int' object has no attribute 'split') because admin.change_view is expecting a string, and tried to "unquote" it. Changing cms/admin/views.py L141 to
response = admin.change_view(request, str(plugin_id))
fixes this problem. Perhaps this patch should be added to the django1.1 branch? (Though it appears to be safely backward compatible anyway, so could be applied to the master branch)

Database migration 0004_textobjects does not apply cleanly on Postgres

South has a bug ( http://south.aeracode.org/ticket/125 ) that affects altering PositiveIntegerFields and PositiveSmallIntegerFields. A temp workaround is to replace them with IntegerFields and SmallIntegerFields. Like this:
diff --git a/cms/migrations/0004_textobjects.py b/cms/migrations/0004_textobjects.py
index 8239461..7b14b50 100644
--- a/cms/migrations/0004_textobjects.py
+++ b/cms/migrations/0004_textobjects.py
@@ -8,7 +8,7 @@ class Migration:
def forwards(self, orm):

     # Adding field 'CMSPlugin.position'
  •    db.alter_column('cms_cmsplugin', 'position', models.PositiveSmallIntegerField(_("position"), null=True, editable=False, blank=True))
    
  •    db.alter_column('cms_cmsplugin', 'position', models.SmallIntegerField(_("position"), null=True, editable=False, blank=True))
    
     # Adding field 'CMSPlugin.parent'
     db.add_column('cms_cmsplugin', 'parent', models.ForeignKey(orm.CMSPlugin, null=True, editable=False, blank=True))
    

    @@ -18,7 +18,7 @@ class Migration:
    def backwards(self, orm):

     # Deleting field 'CMSPlugin.position'
    
  •    db.alter_column('cms_cmsplugin', 'position', models.PositiveSmallIntegerField(_("position"), default=0, editable=False))
    
  •    db.alter_column('cms_cmsplugin', 'position', models.SmallIntegerField(_("position"), default=0, editable=False))
    
     # Deleting field 'CMSPlugin.parent'
     db.delete_column('cms_cmsplugin', 'parent_id')
    

Admin urls handling changed in django 1.1

implement the urls handling as follows for the cms/admin:

def get_urls(self):
    urls = super(MyModelAdmin, self).get_urls()
    my_urls = patterns('',
        (r'^my_view/$', self.my_view)
    )
    return my_urls + urls

in the mean time... till this bug is fixed:

use (r'^admin/(.*)', admin.site.root), in your urls.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.