the closer I got to root is:
www.example.com/es
or
www.example.com/en

for instance.


but www.example.com goes to www.example.com/catalogue





quarta-feira, 22 de Janeiro de 2020 às 16:25:12 UTC, Yahiba escreveu:
>
> I changed this:
>
>
> from Store import views
> urlpatterns = i18n_patterns(
>    url(r'^$', views.home, name ='home'),
> )
>
> urlpatterns += [
>
>     # url(r'/es/^$', views.home, name ='home'),
>     url(r'^sobre-nos/$', views.about, name ='about'),
>     url(r'^dashboard/translation$',views.dashboard_translation, 
> name="dashboard_translation"),
>     url(r'^dashboard/sobre-nos/$', views.sobre_nos, 
> name='dashboard-sobre-nos'),
>     url(r'^dashboard/bem-estar/$', views.bem_estar, 
> name='dashboard-bem-estar'),
>     url(r'^dashboard/home-page/$', views.home_page, 
> name='dashboard-home-page'),
>
> ]
>
>
>
> from django.contrib.sitemaps import views
>
> urlpatterns += [
>
>
>
>     path('store/', include('Store.urls')),
>
>     path('bem-estar/', include('myblog.urls')),
>     path('ckeditor/', include('ckeditor_uploader.urls')),
>     path('i18n/', include('django.conf.urls.i18n')),  # > Django-2.0
>     path('admin/', admin.site.urls),  # > Django-2.0
>
>     path('', include(apps.get_app_config('oscar').urls[0])),  # > 
> Django-2.0
>
>
>     url(r'^sitemap\.xml$', views.index,
>         {'sitemaps': base_sitemaps}),
>     url(r'^sitemap-(?P<section>.+)\.xml$', views.sitemap,
>         {'sitemaps': base_sitemaps},
>         name='django.contrib.sitemaps.views.sitemap'),
>
>
>
> ]+static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>
>
>
>
> but now I can't access root directory again, I am redirected to catalogue 
> despite the language selection
>
>
>
> quarta-feira, 22 de Janeiro de 2020 às 15:08:47 UTC, Samir Shah escreveu:
>>
>> Okay, I see where your issue is now. The problem is here:
>>
>> urlpatterns = [
>>    url(r'^$', views.home, name ='home'),
>> ]
>>
>> Your home URL is not internationalised - it only works for / and not for 
>> any language-prefixed URL. For any language-prefixed URL you'll end up with 
>> Oscar's default home view (which in turn redirects to the catalogue view). 
>> You need to wrap it in django.conf.urls.i18n.i18n_patterns 
>> <https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#django.conf.urls.i18n.i18n_patterns>
>>  
>> (see example in sandbox 
>> <https://github.com/django-oscar/django-oscar/blob/master/sandbox/urls.py#L33>),
>>  
>> something like this:
>>
>>
>> urlpatterns = i18n_patterns(
>>    url(r'^$', views.home, name ='home'),
>> )
>>
>

-- 
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
--- 
You received this message because you are subscribed to the Google Groups 
"django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-oscar+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/django-oscar/a096ce0b-6066-412b-b529-147c0f56c19f%40googlegroups.com.

Reply via email to