Search code examples
pythondjangolinuxnginxplesk

Python / Django Users Profile Page URL Turkish Character Problem


Its working on my localhost. But my server (centos 7-plesk) dosn't wok same code.

Example My user profile link:

domain.com/user/Maşuka

This link working on my localhost without any problem.

But this link auto redirect like this and i give 404 error page:

domain.com/user/Ma%25c5%259fuka/

where is problem? How can i fix this.

What's the difference between localhost and centos? Why working good only localhost.

Myserver (Nginx - Centos - Plesk)


Solution

  • I found the solution by bringing the links to the appropriate structure.

    I just use slugify in my link like this;

    <a href="/user/{{ view.author.username|slugify }}/" >@{{ view.author }}</a>
    

    then my link convert;

    domain.com/user/Maşuka
    

    to

    domain.com/user/Masuka