On Mon, May 30, 2011 at 01:23, wongobongo <[email protected]> wrote: > Thanks for your reply Thomas. My understanding is that context > processors inject global/sitewide variables into the templates and not > the settings object - if this is incorrect please let me know. I > concluded that the error was generated by code in the model not the > template (the SITE_DOMAIN, etc. keys exists in the template just as > you would expect). Specifically lines 123 and 124 in the > send_invitation method of the JoinInvitationManager class pull non- > existent keys from the settings object raising an AttributeError. > > https://github.com/jtauber/django-friends/blob/master/friends/models.py
Hmm, I actually haven't used django-friends yet, so maybe someone that is can report back. However, it looks like the JoinInvitationManager.send_invitation method should be setting the SITE_NAME from get_current() and not from settings.SITE_NAME, or checking to see if pinax is used since the `context_processors.pinax_settings` would also be adding it. Might be a bug, especially since django-friends is intended to be used with and without Pinax, there may have been an oversight here. > I have both pinax's context processor installed and Site 1 configured > in the database as you directed (settings.SITE_ID=1). Yet, one URL in > the site generates errors (try inviting someone by email using the > form in social site - on submit, it raises no errors? Root-relative > URL is "/invitations/invite/"). I do know that the CONTACT_EMAIL must be set in the main settings. > > K > > --- > > AttributeError at /invitations/invite/ > > 'Settings' object has no attribute 'SITE_NAME' > > Request Method: POST > Request URL: http://localhost:8888/invitations/invite/ > Django Version: 1.2.5 > Exception Type: AttributeError > Exception Value: > > 'Settings' object has no attribute 'SITE_NAME' > > > > On May 29, 1:58 am, Thomas Schreiber <[email protected]> wrote: >> Check out pinax/pinax/core/context_processors.py >> andhttps://docs.djangoproject.com/en/dev/ref/contrib/sites/#hooking-into... >> >> You don't need to add SITE_NAME to settings.py, simply create your >> site in the database (can use the admin) and set the SITE_ID, also >> make sure you are including this context processor in your settings. >> >> TEMPLATE_CONTEXT_PROCESSORS = [ >> ... >> "pinax.core.context_processors.pinax_settings", >> ... >> ] >> > > -- > You received this message because you are subscribed to the Google Groups > "Pinax Core Development" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/pinax-core-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Pinax Core Development" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pinax-core-dev?hl=en.
