Re: [mezzanine-users] Send email on new page creation or blogpost using Mezzanine

2016-08-05 Thread Ryne Everett
You could start by writing a function that just prints something to the
console. Then connect it with the post_save signal (and the Page sender).

I find the signals documentation and terminology difficult to interpret
myself but you should be able to figure it out by mimicking the examples.

On Fri, Aug 5, 2016 at 10:30 AM, Michael Ketiku  wrote:

> Thanks, I really don't even know where to start and to be honest I am
> confused but thanks anyways.
>
> On Thursday, August 4, 2016 at 9:52:38 PM UTC-4, Ryne Everett wrote:
>>
>> There are probably a lot of different approaches to this but the first
>> one that comes to mind is django signals
>> . You could
>> listen to the post-save signal
>>  on the
>> Page model and have your handler check if the page is published (and you
>> probably want to make sure it's the first time it's been published) and if
>> so dispatch your emails.
>>
>> It would be great if you implemented this as a reusable app
>>  and
>> shared it with the mezzanine community because it seems like a common
>> blogging-platform feature which we lack. This would also enable us to be
>> more helpful should you run into difficulties because we could see your
>> code.
>>
>> On Thu, Aug 4, 2016 at 6:15 PM, Michael Ketiku  wrote:
>>
>>> Hi everyone, I am a beginning Django developer and I am working with
>>> Mezzanine on my first application. As part of that I would like to find out
>>> how to send an email message to all users of a mezzanine site when a new
>>> page or blog post is created. I looked all through the mezzanine docs but
>>> can not find anything regarding this. Please point me in the right
>>> direction, I have looked at django-alerts and django-notifier but can not
>>> understand how to send emails to users like that.
>>>
>>> Thanks-
>>> Michael
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Mezzanine Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to mezzanine-use...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Mezzanine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mezzanine-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] mezzanine.accounts documentation?

2016-08-05 Thread gdx9000

I am trying to add accounts app to my Mezzanine installation.

Does anyone have a clear uptodate tutorial on how to do this?  The official 
Mezzanine documentation is broken.  I can't really figure out whether it is 
asking me to type myApp literally or the real name of application name: 
accounts.  Also, it has dead links to Django documentation.

So far, I understand that I have to add some python code; otherwise 
accounts module will not work on its own.  The problem is: should I add the 
code to new file models.py?  There already is a models.py as shown below.  
So, should I append it?

Is it better to just use Django with Pinax; given Mezzanine's documentation 
is abstract?  (FWIW: I like abstract art; just not into abstract 
documentation)

ib/python2.7/site-packages/mezzanine/accounts/models.py:

from django.db import DatabaseError, connection
from django.db.models.signals import post_save
from mezzanine.accounts import get_profile_for_user
from mezzanine.conf import settings

__all__ = ()

if getattr(settings, "AUTH_PROFILE_MODULE", None):

def create_profile(**kwargs):
if kwargs["created"]:
try:
get_profile_for_user(kwargs["instance"])
except DatabaseError:
# User creation in initial syncdb may have been triggered,
# while profile model is under migration management and
# doesn't exist yet. We close the connection so that it
# gets re-opened, allowing syncdb to continue and complete.
connection.close()

post_save.connect(create_profile, sender=settings.AUTH_USER_MODEL, 
weak=False)

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] When to use multiple projects, instances, sites?

2016-08-05 Thread gdx9000
Thank you Eduardo.  I like Option 3.  But, how much of coding is required 
to enable Admin for each site?  I cannot find documentation of what *.py to 
create and/or modify for this.

On Sunday, July 24, 2016 at 5:45:52 PM UTC-4, Eduardo Rivas wrote:
>
> Hey there. 
>
> If you want to use the same codebase for multiple sites and domains, 
> option 3 is your best bet. You can even have different frontend themes 
> for each site, but all your installed apps will be the same. Each site 
> will have its own Admin as long as all your models inherit from 
> SiteRelated (which is the case for all Mezzanine apps). 
>
> If you think you're going to be using different installed apps and that 
> each project will require more customization, you should go with option 
> 1. I would advise you never use option 2 because it kinda defeats the 
> concept of sandboxing and encapsulation provided by virtualenvs. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Send email on new page creation or blogpost using Mezzanine

2016-08-05 Thread Michael Ketiku
Thanks, I really don't even know where to start and to be honest I am 
confused but thanks anyways.

On Thursday, August 4, 2016 at 9:52:38 PM UTC-4, Ryne Everett wrote:
>
> There are probably a lot of different approaches to this but the first one 
> that comes to mind is django signals 
> . You could 
> listen to the post-save signal 
>  on the 
> Page model and have your handler check if the page is published (and you 
> probably want to make sure it's the first time it's been published) and if 
> so dispatch your emails.
>
> It would be great if you implemented this as a reusable app 
>  and 
> shared it with the mezzanine community because it seems like a common 
> blogging-platform feature which we lack. This would also enable us to be 
> more helpful should you run into difficulties because we could see your 
> code.
>
> On Thu, Aug 4, 2016 at 6:15 PM, Michael Ketiku  > wrote:
>
>> Hi everyone, I am a beginning Django developer and I am working with 
>> Mezzanine on my first application. As part of that I would like to find out 
>> how to send an email message to all users of a mezzanine site when a new 
>> page or blog post is created. I looked all through the mezzanine docs but 
>> can not find anything regarding this. Please point me in the right 
>> direction, I have looked at django-alerts and django-notifier but can not 
>> understand how to send emails to users like that. 
>>
>> Thanks-
>> Michael 
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to mezzanine-use...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.