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 [email protected].
For more options, visit https://groups.google.com/d/optout.