简体   繁体   中英

How to remove language from the address?

Please help me to solve this problem.

I installed Django-cms, I plan to do a monolingual site. When installing I still need to enter a language code. I introduced the RU.

The problem is that when loading any page it adds the following to the web address

/ru/ 

I need an address which isn't in the language code

Original answer from @ppetrid in How to remove the language identifier from django-cms 2.4 URLs?

I know django-cms is already 3.x version but it should work,

replace this pattern registration:

urlpatterns = i18n_patterns('',
 url(r'^admin/', include(admin.site.urls)),
 url(r'^', include('cms.urls')),
)

with this:

from django.conf.urls import patterns

urlpatterns = patterns('',
  url(r'^admin/', include(admin.site.urls)),
  url(r'^', include('cms.urls')),
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM