Last active
August 23, 2017 19:38
-
-
Save GaretJax/4a1054123289c49cfc1a411c332b89c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form django.shortcuts import redirect | |
def redirect_job_details(request): | |
full_path = request.get_full_path() | |
if full_path.startswith('/en'): | |
full_path = full_path[3:] | |
return redirect('/jobs' + full_path) | |
urlpatterns = [ | |
... | |
url(r'^detail/', redirect_job_details), | |
... | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment