Cms - Content Management System Utilities for Django

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    2 Favorites & 1 Group

    Cms - Content Management System Utilities for Django - Presentation Transcript

    1. Cmsutils Content Management System Utilities for Django Maik Röder Yaco Sistemas Python Meetup Barcelona 3.4.2008
    2. Cmsutils
      • GPL License
      • https://tracpub.yaco.es/cmsutils/
      • Yaco Sistemas
      • http://www.yaco.es
      • BTW: We hire Python developers!
      • Features
      • Generic parameters from database
      • Generic reusable forms based on newforms
      • Generic views and templates for things like deleting objects
      • Breadcrumb templatetag
      • Messagebox
      • Merging and compressing JS and CSS
      • LDAP authentication
    3. Cmsutils
      • Parameter model for customer specific parameters
        • administrator email
        • contact information
        • copyright
      • Useful in Templates
      • {% load parameter %}
      • <strong>Information successfully sended to {{ param &quot;default_email&quot; }}</strong>
      • Useful in your Django models:
      • def fooview(request):
      • default_email = Parameter.objects.get_value(&quot;default_email&quot;, settings.DEFAULT_FROM_EMAIL)
    4. Cmsutils
      • Generic reusable forms based on newforms.
        • GenericForm
        • GenericAddForm
        • GenericEditForm
      • EditForm Example
      • class AuthorEditForm(GenericAddForm):
      • template = 'authors/edit.html'
      • class Meta:
      • model = Author
      • fields = ('name', 'description',)
      • def edit(request, author_id):
      • author = get_object_or_404(Author, pk=author_id)
      • form = AuthorEditForm(request, author)
      • return form.run()
    5. Cmsutils
      • Generic views and templates for things like deleting objects
      • confirm_delete.html
      • delete_link.html
      • edit_object.html
      • def confirm_delete_object(request):
      • content_type_id = request.GET.get('content_type_id', None)
      • object_id = request.GET.get('object_id', None)
      • if content_type_id is None or object_id is None:
      • raise Http404
      • return render_to_response('cmsutils/confirm_delete.html',
      • {'content_type_id': content_type_id,
      • 'object_id': object_id},
      • context_instance=RequestContext(request))
    6. Cmsutils
      • Breadcrumb templatetag
      • {% load breadcrumbs %}
      • <body>
      • {% breadcrumbs News:/news/ object %}
      • ...
      • </body>
      • HTML Output:
      • <div class=&quot;breadcrumbs&quot;>
      • <li class=&quot;previous&quot;><a href=&quot;/&quot;>Home</a> | </li>
      • <li class=&quot;previous&quot;><a href=&quot;/news/&quot;>News</a> | </li>
      • <li><a href=&quot;/news/1/&quot;>Foo news item</a></li>
      • </div>
    7. Cmsutils
      • Messagebox
      • {% autoescape off %}
      • {% if portal_messages %}
      • <ul id=&quot;info-list&quot;>
      • {% for message in portal_messages %}
      • <li>{{ message }}</li>
      • {% endfor %}
      • </ul>
      • {% endif %}
      • {% endautoescape %}
    8. Cmsutils
      • Merging and compressing JS and CSS
      • This will merge css/javascript files in only one compressed css/javascript.
      • Usage:
      • {% load [js|css]merge %}
      • {% [js|css]merge name [file1] [file2] .. %}
      • Example:
      • {% load jsmerge %}
      • {% jsmerge jsmergefile js/file1.js js/file2.js js/file3.js %}
      • This will create (if not exists) a /media/jsmergefile.js with three
      • files merged. The HTML output for this will be:
      • <script type=&quot;text/javascript&quot; src=&quot;/media/jsmergefile.js&quot;></script>
    9. Cmsutils
      • LDAP authentication
      • AUTHENTICATION_BACKENDS = (
      • 'cmsutils.auth.backends.LDAPBackend',
      • 'django.contrib.auth.backends.ModelBackend',
      • )
      • AUTH_LDAP_SERVER = 'ldap.foo.com'
      • AUTH_LDAP_BIND_USERNAME = 'cn=admin,dc=ldap,dc=foo,dc=com'
      • AUTH_LDAP_BIND_PASSWORD = 'foopasswd'
      • AUTH_LDAP_SUBTREE = 'ou=People,dc=ldap,dc=foo,dc=com'
      • AUTH_LDAP_FILTER = '(&(objectclass=person) (uid=%s))'
      • AUTH_LDAP_MAP = {'login': 'uid', 'name': 'cn', 'surname': 'sn', 'mail': 'mail'}
    10. Cmsutils Check it out!
      • https://tracpub.yaco.es/cmsutils
      • svn checkout http://svnpub.yaco.es/cmsutils/trunk cmsutils

    + maikroedermaikroeder, 2 years ago

    custom

    2735 views, 2 favs, 0 embeds more stats

    I used these slides for a presentation at the Barce more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 2735
      • 2735 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 71
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events