On my local development machine I’ve already successfully installed django-simple-captcha. However, when I run it on the production server, the table is not found, resulting in a TemplateSyntaxError.
Caught DatabaseError while rendering: no such table: captcha_captchastore
I’m using sqlite3 as database engine and had already run python manage.py syncdb and checked the created tables with the following SQL statement:
sqlite> select name from sqlite_master where type = ‘table’;
auth_permission
auth_group_permissions
auth_group
auth_user_user_permissions
auth_user_groups
auth_user
auth_message
django_content_type
django_session
django_site
django_admin_log
captcha_captchastore
However, even if all the other tables work just fine, captcha_captchastore is not found. What could be possible reasons for this failure and how to fix it?
Additional findings:
When I run the Django development server on the production machine and check back everything works fine. Apparently it has something to do with the way I run Django. I currently have a setup with nginx and Django via fastcgi. The launch command is the following:
python manage.py runfcgi host=127.0.0.1 port=8081 --settings=settings
How can this influence finding the database or not? Probably there is a path problem.
I couldn’t find out how the path to databases is constructed when you are in a template environment or in the scope of another app, but setting an absolute path name fixes the issue.