0

I'm using Django Userena to configure my user profiles. The site works like this: User#1 creates Object#1 on my site. Afterwards, I want to enable other people to message User#1 about Object#1 using Userena's messaging system.

I realize that you can get a user's email like this:

{{ object.user.email }}

but I dont want to expose my user's emails on the internet and would prefer to use userena's messaging system.

How would you do this? Would I create a link on the page to userena's write view, including the username as a parameter?

I have to admit I am pretty lost on how to do this, but as it seems like a common problem, I hope for any good suggestions. Thank you!

Nick B
  • 9,267
  • 17
  • 64
  • 105
  • If you want users to be able to message each other, [look at this question](http://stackoverflow.com/questions/4577553/private-messaging-in-django) – Lennart Regebro Jan 23 '13 at 06:34

1 Answers1

0

You will need to install userna's messaging framework, by adding userena.contrib.umessages to your INSTALLED_APPS setting. You also need to add it to your urlconf. For example:

(r'^messages/', include('userena.contrib.umessages.urls')),

Now, if you go to an url like /messages/compose/username_1+username_2+username_3/ then a message can be sent to all those 3 users whose username is in URL.

Please have a look at urls.py and views.py to learn more.

If interested, you should look into models.py as well to know what all models are being used for this.

pankaj28843
  • 2,458
  • 17
  • 34