Wednesday, December 17, 2008

Django and Turbogears: The registration problem

So I downloaded django a couple weeks ago to get some experience with before I go and get my non-profit on at the http://overnightwebsitechallenge.com (where I'll be working in django).   I normally work in turbogears and have the turbogears registration egg installed already for use on my other projects.  

So here is problem, I installed the django registration eggs, and wanted to get started with users and registration on django, but I kept getting errors with the import of the registration in settings.py.  

Well long story short, the problem turns out to be that both django and turbogears want to use 'registration' as the name of the module to import.  With that being the case, whichever egg was installed first will be importing first and therefore be used.  In my case that was the turbogears egg, b/c I installed that first (a long time ago).  So onto the fix... in manage.py:

import sys
sys.path.insert(0, "yourpathhere/django_registration-0.7-py2.5.egg")

That will ensure that the django registration package is pulled in at the top of your python path and will be used instead of the turbogears one.

Problem solved. After 5 hours.
blog comments powered by Disqus