mbi / django-rosetta

Rosetta is a Django application that eases the translation process of your Django projects
MIT License
1.07k stars 195 forks source link

Docs aren't up-to-date and don't work with latest django #286

Closed lc-thomas closed 6 months ago

lc-thomas commented 6 months ago

Installing and configuring rosetta using the docs instructions fails with urls.py :

from django.conf.urls import include, re_path

if 'rosetta' in settings.INSTALLED_APPS:
    urlpatterns += [
        re_path(r'^rosetta/', include('rosetta.urls'))
    ]

ImportError: cannot import name 're_path' from 'django.conf.urls'

I thought it had to be replaced by 'path' but I still cannot get it to work...

lc-thomas commented 6 months ago

Just found the solution, re_path still exists, it has just been moved from django.conf.urls to django.urls So

from django.conf.urls import include, re_path

should be replaced with :

from django.urls import include, re_path
mbi commented 6 months ago

Yea, the correct import should be

from django.urls import include, re_path

Fixed, thank you.