PyLucid CMS Logo

blog

tag cloud ajax | Amazon | Apache | Aptana | backward incompatible | blog | browser | bugfix | ColorMirror | creole | database | dbtemplates | development | django | django-reversion | django-sync | django-sync-server | django-tagging | django-tools | django-weave | DjangoBB | documentation | dokumentation | Eclipse | editor | encoding | fastcgi | firefox | firefox sync | formset | generic | git | gunicorn | honypot | html | HTML dump | include | IRC | javascript | JS-SHA-Login | linux | login | mysql | nginx | pip | plugin | politik | pydev | pygments | pylucid | python | release | screencast | screencasts | security | server | sicherheit | software | sqlite | standalone | suchmaschine | svn | test | textile | unittest | v0.10 | v0.11 | virtualenv | visible changes | web | webspace

↑ Nov. 20, 2012 - New in PyLucid v1.4.2  #

Before 5 months, 4 weeks published by jens.

Some bugfixes and a new flickr functionality added in v1.4.2:

More information about the flickr stuff is in the documentation page. Some examples are here:

tags development | pylucid | visible changes
0 comments...

↑ Oct. 18, 2012 - static HTML dump  #

Before 7 months published by jens.

We started a django management command to create a static HTML dump of a web page:

So it should be possible to create a snapshot of your complete site to e.g. put it via FTP on a second web server or to a sub-domain etc.

To create a dump e.g.:

Bash
1
/var/www/YourSite$ ./manage.py html_dump /var/www/static_dump/

To test the snapshot you can run a simple HTTP server e.g.:

Bash
1
2
3
/var/www/YourSite$ cd /var/www/static_dump/
/var/www/static_dump$ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...

Note: Don't use this server in production ;)

(Last update: Oct. 18, 2012, 2:39 p.m. by jens.)

tags development | HTML dump | pylucid
0 comments...

↑ Sept. 7, 2012 - Traps if you made a dist upgrade...  #

Before 8 months, 1 week published by jens.

I traped in some problems while update ubuntu 10.04TLS to 12.04TLS.

Generally: You must allways recreate the PyLucid virtual environment, if python version changed. In this case python v2.6 to v2.7. This is needed, because many symlinks doesn't work after a version change.

So bootstrap PyLucid:

Bash
1
2
3
4
5
6
7
8
9
# get PyLucid boot script:
# First make a "backup":
/home/FooBar$ mv PyLucid_env PyLucid_env_OLD

# Get the newest boot script:
/home/FooBar$ wget --timestamp https://raw.github.com/jedie/PyLucid/master/bootstrap/pylucid-boot.py

# Create the PyLucid virtual environment:
/home/FooBar$ python pylucid-boot.py PyLucid_env

Some problems:

  • You must relink all external plugins.
  • You must install all additional dependencies.
  • Delete old cache entries, e.g.: $ rm /tmp/PyLucid* -rf

If you use DjangoBB you should recreate the search index, e.g.:

Bash
1
/var/www/YourSite$ ./manage.py update_index --verbosity=2

↑ Error: "No module named auth_backends"  #

Also a strage error:
Error importing authentication backend pylucid.system.auth_backends.SiteSHALoginAuthBackend: "No module named auth_backends"
In settings is:

Python
1
2
AUTHENTICATION_BACKENDS = ('pylucid_project.pylucid_plugins.auth.auth_backends.SiteAuthBackend',
 'pylucid_project.pylucid_plugins.auth.auth_backends.SiteSHALoginAuthBackend')

So what happens here?!?!

The code from django/contrib/auth/__init__.py in get_user is:

Python
1
2
3
user_id = request.session[SESSION_KEY]
backend_path = request.session[BACKEND_SESSION_KEY]
backend = load_backend(backend_path)

So the backend is not directly used from settings.AUTHENTICATION_BACKENDS. It used from old session data!

Solution: Delete all existing settings, e.g.:

Bash
1
/var/www/YourSite$ ./manage.py reset sessions

↑ MySQL  #

If you use MySQL and hase set default-character-set and/or default-collation in /etc/mysql/my.cnf, than you will have the next problem. These settings was deprecated and doesn't be accepted with newer MySQL v5.5.x

You only need to set this:

character-set-server=utf8
collation-server=utf8_unicode_ci

(Last update: Sept. 7, 2012, 6:35 p.m. by jens.)

tags linux | mysql | pylucid | software
0 comments...

↑ Aug. 30, 2012 - PyLucid v1.4.1 changes...  #

Before 8 months, 3 weeks published by jens.

We improve the JS-SHA-Login in v1.4.1

The biggest changes are:

  • add 'hash based key stretching' via configurable loop count (via django-dbpreferences)
  • use a client generated nonce, too.
  • check that nonce didn't used in the past.
  • Add/update unittests for all changes

Complete changes are:

Important: This is only backward incompatible if you didn't used link static files. In this case you need to update with, e.g.:

Bash
1
2
# collect all static files as links
/var/www/YourSite$ ./manage.py collectstatic

If you have used --link in this command, you must do nothing. More info in the documentation page

tags development | JS-SHA-Login | pylucid | visible changes
0 comments...

↑ Aug. 28, 2012 - PyLucid v1.4.0 changes...  #

Before 8 months, 3 weeks published by jens.

(Last update: Aug. 28, 2012, 3:28 p.m. by jens.)

tags backward incompatible | development | pylucid
0 comments...

↑ Aug. 24, 2012 - new cache stuff in django-tools  #

Before 8 months, 3 weeks published by jens.

I have implement and refactor two things in django-tools about caching:

smooth cache backends and per-site cache middleware

per-site cache middleware is similar to django UpdateCacheMiddleware and FetchFromCacheMiddleware, but has some enhancements, e.g.::

  • Skip cookies and attributes like response.csrf_processing_done
  • ignores: response['Vary']

So, it's more effective for anonymous caching: The django middleware would vary on cookie. So it's de-facto a cache per anonymous user...

smooth cache backends are the same as django cache backends, except that cache.clear() clears the cache smoothly depend on the current system load.

think i will change cache.clear() to somethign else, e.g: cache.smooth_update() - https://github.com/jedie/django-tools/issues/3

more info in README here:
https://github.com/jedie/django-tools/tree/master/django_tools/cache

This stuff would be used in PyLucid since the last release, see also: PyLucid v1.3.0 changes...

tags django-tools
0 comments...

↑ Aug. 21, 2012 - PyLucid v1.3.0 changes...  #

Before 9 months published by jens.

↑ how to update  #

Use our Update CLI script and update:

  • first run:
    • PyLucid
  • second run:
    • django-tools
    • django-reversion
    • django-compressor

Maybe your templates must be changed, if you have used debug in it, e.g.:

Diff
1
2
- {% if debug %}
+ {% if request.debug %}

↑ CACHES  #

You can leave your old CACHES settings untouched. But it's a good idea to use the new "smooth cache backends", because:

  • The default PyLucid settings used the SmoothLocMemCache backend. But this isn't very memory-efficient.
  • You can use the normal django cache backends. But PyLucid clears the cache with cache.clear() completely after e.g. a page was edited. This isn't effective with the normal backends.

Example settings can look like:

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CACHE_MIDDLEWARE_SECONDS = 3600 # 1h

_BACKEND = "django_tools.cache.smooth_cache_backends.FileBasedCache"
_LOCATION_PREFIX = "/var/tmp/PyLucid_"
CACHES = {
    'default': {
        'BACKEND': _BACKEND,
        'LOCATION': _LOCATION_PREFIX + 'default-cache',
        'TIMEOUT': CACHE_MIDDLEWARE_SECONDS,
    },
    'dbtemplates': {
        # http://django-dbtemplates.readthedocs.org/en/latest/advanced/#caching
        'BACKEND': _BACKEND,
        'LOCATION': _LOCATION_PREFIX + 'dbtemplates-cache',
        'TIMEOUT': CACHE_MIDDLEWARE_SECONDS,
    },
    LOCAL_SYNC_CACHE_BACKEND: {
        # https://github.com/jedie/django-tools/blob/master/django_tools/local_sync_cache/local_sync_cache.py
        'BACKEND': _BACKEND,
        'LOCATION': _LOCATION_PREFIX + 'local_sync-cache',
        'TIMEOUT': CACHE_MIDDLEWARE_SECONDS,
    },
}

Note:

Please read the updated informations!

↑ changes  #

↑ visible changes  #

↑ Bugfixes  #

↑ internals  #

↑ filemanager  #

↑ middlewares  #

We used a new middleware from django-tools to set request.debug like:

Python
1
request.debug = settings.DEBUG or request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS

Note that this is a OR contraint and not a AND !

We also remove "debug" from context processors. Because django.core.context_processors.request is used and so you can access it via request.debug...

update external packages:

Diff
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# http://pypi.python.org/pypi/django-tools
-django-tools>=0.24,<0.25
+django-tools>=0.24.10,<0.25

 # https://github.com/etianen/django-reversion
 # http://pypi.python.org/pypi/django-reversion
-django-reversion>=1.6,<1.7
+django-reversion>=1.6.2,<1.7

 # https://github.com/jezdez/django_compressor
 # http://pypi.python.org/pypi/django_compressor/
-django_compressor==dev
+django_compressor>=1.2,<1.3

(Last update: Aug. 24, 2012, 2:46 p.m. by jens.)

tags backward incompatible | development | pylucid | visible changes
0 comments...

↑ Aug. 21, 2012 - PyLucid v1.2.1 changes...  #

Before 9 months published by jens.

We add with commit 24dd533 a admin action to userprofile to change the site for multiple users at the same time:


screenshot

tags development | pylucid | visible changes
0 comments...

↑ Aug. 3, 2012 - DjangoBB modifications  #

Before 9 months, 2 weeks published by jens.

I start contributing to DjangoBB in a github fork here: https://github.com/jedie/DjangoBB

Here runs my DjangBB 'dev' branch. Which contains all pending changes from by fork.
github compare view: https://github.com/jedie/DjangoBB/compare/dev

biggest goals:

  • Use django.contrib.messages for feedback
  • Expand the code tag list in Markitup
  • merge reply / quote stuff

more info: https://github.com/jedie/DjangoBB#readme

Discuss: http://www.pylucid.org/en/forum/topic/347/

tags DjangoBB
0 comments...

↑ Aug. 3, 2012 - PyLucid v1.2.0 changes  #

Before 9 months, 2 weeks published by jens.

About the changes https://github.com/jedie/PyLucid/compare/v1.1.2...v1.2.0

It's not really backward incompatible, because no admin action is needed for update. The only backward incompatible changes are the PyLucid search API and that is only interesting for developers ;)

main goals are:

We added a preferences value to specify the max hit count to skip a plugin search. Go to:

  • Django admin site / Dbpreferences / Preferences / SearchPreferencesForm

(The default value is 100)

↑ how to update  #

Update with cli script and select both PyLucid and django-dbtemplates

If you use DjangoBB Forum as a plugin, update the plugin, too.

↑ more information  #

With commit 8c47778 we changed the search API a little bit: We split the plugin search function, to filter the real search if there are too much hits.

(Last update: Aug. 3, 2012, 9:08 a.m. by jens.)

tags backward incompatible | development | pylucid | visible changes
0 comments...
Syndication feed format:
0 comments for 'blog':
    there exist no comment for 'blog'
Leave a comment
tag navi developing

django-processinfo: 4.8 ms of 603.9 ms (0.8%)