Showing posts with label django. Show all posts
Showing posts with label django. Show all posts

23 May 2011

Django Offline Messages on PyPI

Finally decided to add Django Offline Messages to PyPI. Was very wondered that it could be done so easy, just type

python setup.py register



And got the result in some seconds:
running register
warning: register: missing required meta-data: url
Registering django-offline-messages to http://pypi.python.org/pypi
Server response (200): OK

07 February 2011

Django Offline Messages

There was a way in Django to leave a message in User.message_set, so the user will be able to see this message after login. But this storage is deprecated as of now and will be totally removed in Django 1.4. That forced me to create database storage for messages. Here it is: django-offline-messages.

To use it you have to add some options to your settings.py file:

  • Add 'offline_messages' to INSTALLED_APPS

  • Set MESSAGE_STORAGE to 'offline_messages.storage.OfflineStorageEngine'



If you want to create a message, just type:

from offline_messages.utils import create_offline_message

user = User.objects.get(username='dbudashny')
create_offline_message(user, "This is a message")

Total Pageviews

Followers