Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-1 -2 -3 -4 Page URLS #87

Open
davidrenne opened this issue May 14, 2015 · 1 comment
Open

-1 -2 -3 -4 Page URLS #87

davidrenne opened this issue May 14, 2015 · 1 comment

Comments

@davidrenne
Copy link

I had a requirement to change my urls from /?page=1 ?page=2 etc etc to a slug folder like -1/ -2/ -3/

I implemented it like this:

davidrenne@f490a76

It is a bit hacky because I am translating the page parameter from URLS.py

    url(r'^$', views.index, name='website_profiles_home'),
    url(r'-(?P<page>\d+)/$', views.index_page, name='website_profiles_home_next'),

Where my original use case was views.index paginating just fine.

I created a dash version which had this contents for the stubbed view:

def index_page(*args, **kwargs):
    args[0].GET = args[0].GET.copy()
    args[0].GET['page'] = kwargs['page']
    return index(*args, **kwargs)

It might be nice if someone could use your base tool like this, but a little less hacky where you can receive the page from a stub view that you can import from endless and a stub URL from endless which would setup the fake page.

Just an idea if anyone knew, but URLs which have a folder name would rank higher than those with a get parameter with SEO.

Close if you want, but I wanted to suggest something more elegant that you guys can support maybe as a configuration.

@davidrenne
Copy link
Author

davidrenne@c066c75

Added setting where I had a hard coded True for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant