Versions:
- Python 3.5.1
- Django 1.10
- django-rosetta 0.7.13
The installation guide tells you to add the following to your project's settings.py:
from django.conf import settings
if 'rosetta' in settings.INSTALLED_APPS:
urlpatterns += patterns('',
url(r'^rosetta/', include('rosetta.urls')),
)
However, this just results in an error:
NameError: name 'patterns' is not defined
Searching for that problem reveals that one apparently has to import it:
But still it doesn't work.
This function was removed in django 1.10. However, one can add the rosetta urls conditionally using this approach:
However, if you try to access rosetta at the url http://127.0.0.1:8000/rosetta/ you might be surprised to find that you still get a
404 Page not found.So it seems that the included patterns are not working properly. But they are. The problem is that there's a hidden requirement that one must be logged in when accessing the rosetta page (maybe with a staff/super user?). So, simply go to http://127.0.0.1:8000/admin/, log in, and then go to the rosetta url again. Now it should work.
The installation does note this, sort of:
How does it know you are an administrator if you are not logged in? It doesn't, and apparently instead of giving an informative error, it ignores the rosetta urls entirely.