Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7532853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:34:23+00:00 2026-05-30T05:34:23+00:00

Im actually working in a django project and I’m not sure about the best

  • 0

Im actually working in a django project and I’m not sure about the best format of the URL to access into one particular object page.

I was thinking about these alternatives:

1) Using the autoincremental ID => .com/object/15

This is the simplest and well known way of do that. “id_object” is the autoincremental ID generated by the database engine while saving the object. The problem I find in this way is that the URLs are simple iterable. So we can make an simple script and visit all the pages by incrementing the ID in the URL. Maybe a security problem.

2) Using a <hash_id> => .com/object/c30204225d8311e185c3002219f52617

The “hash_id” should be some alphanumeric string value, generated for example with uuid functions. Its a good idea because it is not iterable. But generate “random” uniques IDs may cause some problems.

3) Using a Slug => .com/object/some-slug-generated-with-the-object

Django comes with a “slug” field for models, and it can be used to identify an object in the URL. The problem I find in this case is that the slug may change in the time, generating broken URLs. If some search engine like Google had indexed this broken URL, users may be guided to “not found” pages and our page rank can decrease. Freezing the Slug can be a solution. I mean, save the slug only on “Add” action, and not in the “Update” one. But the slug can now represent something old or incorrect.

All the options have advantages and disadvantages. May be using some combination of them can some the problems.
What do you think about that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:34:24+00:00Added an answer on May 30, 2026 at 5:34 am

    I think the best option is this:

    .com/object/AUTOINCREMENT_ID/SLUG_FIELD
    

    Why?

    First reason: the AUTOINCREMENT_ID is simple for the users to identify an object. For example, in an ecommerce site, If the user want to visit several times the page (becouse he’s not sure of buying the product) he will recognize the URL.

    Second reason: The slug field will prevent the problem of someone iterating over the webpage and will make the URL more clear to people.

    This .com/object/10/ford-munstang-2010 is clearer than .com/object/c30204225d8311e185c3002219f52617

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a WTL project, actually WTL 8.1 with VS2008. In many tutorials
I'm new to Django (and databases in general), and I'm not sure how to
I actually working on a website-project. Behind my website, I´ve got a database with
I am working on a django app. One part would involve uploading files (e.g.
I'm having major problems getting Django working with my Apache configuration. I did not
I'm currently working on a project using Django 1.3 with the Django-Celery app. It's
Context I am actually working on a project where I need to compose a
I'm working on a Google App Engine project using Django. I noticed that for
I'm actually working on a website project. I'm new with web services. I have
I'm actually working at MOSS 2007 project where I have to import data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.