Sphene Community Tools

Community

Copyright © 2007-2009 by Herbert Poul
You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools

Profile for pigletto



Name pigletto
Email Address Reveal this emailaddress
Posts43
  • Re: Where are media files kept? What are the urls?
    Board » General
    But what are you asking for?

    MEDIA_URL is set in settings.py - as in all Django applications, but this is only URL. Filesystem location of media files is shown by MEDIA_ROOT setting.

    There might also be some urls definitions for media in urls.py (usually used only in DEBUG mode), but in production you should serve static files from another server.
  • Re: Private messages: first implementation
    Board » General » Feature Discussions
    I've implemented private messages at my forum: http://ekrawiectwo.net. There is no need to reinvent the wheel. I've simply used django-messages and integrated it with SCT by adding 'Send message' link to user profiles.
    The only drawback is that django-messages doesn't use SCT Groups so if you're using these then you may need to do some changes in django messages code.

    If you have any questions feel free to ask.
  • SCT at djangopackages
    Board » General
    I've just added SCT to djangopackages. See grid forums: http://djangopackages.com/grids/g/forums/

    You can add it into another grids too.
  • Re: Updates in SCT
    Board » General » Feature Discussions
    I did some more changes:

    - Attachment upload now uses formsets (this allows changing and removing attachments).
    Beware that associated template (_displayPostForm.html) was also changed so any custom overrides of this template should be updated to use formsets.

    - Added SPHFileWidget that is used by upload form (based on AdminFileWidget)
    - Fix for displaying posts in sphcomments (use is_hidden=0)
    - Added CACHE_MIDDLEWARE_KEY_PREFIX to some cache keys in SCT
    - Added root_post__category, root_post__author, latest_post__author to select_related clause at sphboard.views->showCategory to reduce amount of database queries
    - Fixed bug in user registration that caused no Response object to be returned if there were any errors in Registration form (eg. invalid password repetition)
    - Added HISTORY.txt file with full descirpiton of all recent changes. This might be helpful for creating next release.
  • Re: Updates in SCT
    Board » General » Feature Discussions
    I've checked my site with Django Debug Toolbar and noticed that main page (categories list) generates about 260 database queries... another pages are also heavily using database.
    I didn't found a way to reduce amount of queries by using eg. select_related so I've decided to add some caching to SCT.
    Now, with caching enabled, amount of queries seems to be significantly reduced (for about half) but it is still rather big number.

    I've added caching to _get_absolute_url in thread and category and for username rendering. I've also added some code to refresh cache when specific objects are changed.
  • Re: Updates in SCT
    Board » General » Feature Discussions
    Few more changes:
    1. Updated feeds for Sphboard to Django 1.2. Possible issue might be for sites that use customized feed templates for LatestThreads feed as currently no templates are used there (I wanted to use body_escaped(render_signature=False) so I've used item_title and item_description)

    2. Upgraded pagination. Template tag sph_pagination now accepts additional argument: compress = 1/0. If compress is set to 1 then list of paginated pages is limited to show at most 7 pages with current page at the middle. Take a look at pagination links at: http://ekrawiectwo.net/board/thread/18/stroje-dla-dzieci-pajesi/?page=9 to see what I'm talking about.

    If parameter page passed to sph_pagination tag is '-1' - this happens eg. for list of pages displayed for thread, then with compress=1 list of pages is limited to show only six links (three at the begining and three at the end). Again, take a look at this page: http://ekrawiectwo.net/board/show/8/nasze-dziela/ and notice links near thread with 'Xanti' word in its subject.

    To use compress=1 call:
    {% sph_pagination page pages '' 'page' 1 %}

    Currently it is not used in original Sphene templates.

  • Re: Updates in SCT
    Board » General » Feature Discussions
    Done!

    I've also slightly changed sct_pagination to allow it to pass additional query_string attibutes between pages.
    This was necessary because when I added sorting to (new) list of sct users then orderby parameter was not passed to second page.
  • Re: Updates in SCT
    Board » General » Feature Discussions
    So, what about adding {% csrf_token %} to all Sphene templates? I can do these changes, but this will break backward compatibility with Django versions lower than 1.2.
  • Re: Updates in SCT
    Board » General » Feature Discussions
    I've commited another changes:
    - fixed displaying of user at 'Edit profile' page. Because 'user' variable was passed into template it messed with user from context processor
    - slightly changed toggle_monitor methods to allow admin toggling monitors for users
    - added list of active monitors to user profile

    I've noticed one problem with Django 1.2 and sphene.
    Currently Sphene doesn't use {% csrf_token %} so if someone wants to use csrf_middleware then he has to override all templates containing <form method="post" and add csrf_token.

  • Re: Updates in SCT
    Board » General » Feature Discussions
    I use 1.2.3 but not yet at production site. Anyway I didn't find any issues with compatibility so far.
    I think that it would be necessary to decide about dropping support for older Django releases.
    For example message backend is completly rewriten in Django 1.2 and SCT still has to use user.message_set.create(...).

    I wonder about adding few more features: eg. list of active monitors at user profile (with disable button) and maybe management view to add/edit/remove categories (currently it is only possible from Admin panel). Unfortunatelly I don't know if and when I'll have some time to do it.

    --- Ostatnio edytowane 2010-10-28 22:53:39 przez pigletto ---


Powered by Sphene Community Tools