How to create unique URLs in django?











up vote
1
down vote

favorite












My project is type of a blog. In this blog I need to post news. I can just add news with Django admin page and display all the news in one url. Now I want each news to have a unique URL.



My models.py:



from django.db import models

class Newsform(models.Model):
headline = models.CharField(max_length=50)
description = models.CharField(max_length=100, default='')
content = models.CharField(max_length=100, default='')
image = models.ImageField(upload_to='news_image', blank=True)


views.py:



from django.shortcuts import render
from blog.models import Newsform

def show_content_from_database(request):
headline_news=Newsform.objects.all()
context = {
'headline_news': headline_news
}
return render(request, 'blog/index.html', context)


Here is urls.py:



from django.urls import path
from . import views

urlpatterns = [
path('', views.show_content_from_database,
name='show_content_from_database'),
]


And for the last, the part of index.html, where I display the titles of every news:



{% for headline in headline_news %}
<h1>{{ headline.headline }}</h1>
{% endfor %}


At best, I'd like to post a unique link to the news here: <h1>{{ headline.headline }}</h1>, and that unique page has to extend some base.html.



I've searched the solution of my problem in the internet, but didn't find. This task may be big enough, so I'd like to see a link to some example in the internet (youtube, or stackoverflow, or github, etc).










share|improve this question






















  • yeah, i understand that my question is complicated. But I don't even have an idea where to start.
    – Alex Kondrashov
    Nov 7 at 17:56






  • 3




    But this is literally the thing that Django was designed for, and there are thousands of tutorials telling you how to create your own blog with links to individual pages.
    – Daniel Roseman
    Nov 7 at 17:58






  • 1




    "I've searched the solution of my problem in the internet, but didn't find." Have you done Django's (very good) tutorial? It definitely covers this.
    – Chris
    Nov 7 at 18:01















up vote
1
down vote

favorite












My project is type of a blog. In this blog I need to post news. I can just add news with Django admin page and display all the news in one url. Now I want each news to have a unique URL.



My models.py:



from django.db import models

class Newsform(models.Model):
headline = models.CharField(max_length=50)
description = models.CharField(max_length=100, default='')
content = models.CharField(max_length=100, default='')
image = models.ImageField(upload_to='news_image', blank=True)


views.py:



from django.shortcuts import render
from blog.models import Newsform

def show_content_from_database(request):
headline_news=Newsform.objects.all()
context = {
'headline_news': headline_news
}
return render(request, 'blog/index.html', context)


Here is urls.py:



from django.urls import path
from . import views

urlpatterns = [
path('', views.show_content_from_database,
name='show_content_from_database'),
]


And for the last, the part of index.html, where I display the titles of every news:



{% for headline in headline_news %}
<h1>{{ headline.headline }}</h1>
{% endfor %}


At best, I'd like to post a unique link to the news here: <h1>{{ headline.headline }}</h1>, and that unique page has to extend some base.html.



I've searched the solution of my problem in the internet, but didn't find. This task may be big enough, so I'd like to see a link to some example in the internet (youtube, or stackoverflow, or github, etc).










share|improve this question






















  • yeah, i understand that my question is complicated. But I don't even have an idea where to start.
    – Alex Kondrashov
    Nov 7 at 17:56






  • 3




    But this is literally the thing that Django was designed for, and there are thousands of tutorials telling you how to create your own blog with links to individual pages.
    – Daniel Roseman
    Nov 7 at 17:58






  • 1




    "I've searched the solution of my problem in the internet, but didn't find." Have you done Django's (very good) tutorial? It definitely covers this.
    – Chris
    Nov 7 at 18:01













up vote
1
down vote

favorite









up vote
1
down vote

favorite











My project is type of a blog. In this blog I need to post news. I can just add news with Django admin page and display all the news in one url. Now I want each news to have a unique URL.



My models.py:



from django.db import models

class Newsform(models.Model):
headline = models.CharField(max_length=50)
description = models.CharField(max_length=100, default='')
content = models.CharField(max_length=100, default='')
image = models.ImageField(upload_to='news_image', blank=True)


views.py:



from django.shortcuts import render
from blog.models import Newsform

def show_content_from_database(request):
headline_news=Newsform.objects.all()
context = {
'headline_news': headline_news
}
return render(request, 'blog/index.html', context)


Here is urls.py:



from django.urls import path
from . import views

urlpatterns = [
path('', views.show_content_from_database,
name='show_content_from_database'),
]


And for the last, the part of index.html, where I display the titles of every news:



{% for headline in headline_news %}
<h1>{{ headline.headline }}</h1>
{% endfor %}


At best, I'd like to post a unique link to the news here: <h1>{{ headline.headline }}</h1>, and that unique page has to extend some base.html.



I've searched the solution of my problem in the internet, but didn't find. This task may be big enough, so I'd like to see a link to some example in the internet (youtube, or stackoverflow, or github, etc).










share|improve this question













My project is type of a blog. In this blog I need to post news. I can just add news with Django admin page and display all the news in one url. Now I want each news to have a unique URL.



My models.py:



from django.db import models

class Newsform(models.Model):
headline = models.CharField(max_length=50)
description = models.CharField(max_length=100, default='')
content = models.CharField(max_length=100, default='')
image = models.ImageField(upload_to='news_image', blank=True)


views.py:



from django.shortcuts import render
from blog.models import Newsform

def show_content_from_database(request):
headline_news=Newsform.objects.all()
context = {
'headline_news': headline_news
}
return render(request, 'blog/index.html', context)


Here is urls.py:



from django.urls import path
from . import views

urlpatterns = [
path('', views.show_content_from_database,
name='show_content_from_database'),
]


And for the last, the part of index.html, where I display the titles of every news:



{% for headline in headline_news %}
<h1>{{ headline.headline }}</h1>
{% endfor %}


At best, I'd like to post a unique link to the news here: <h1>{{ headline.headline }}</h1>, and that unique page has to extend some base.html.



I've searched the solution of my problem in the internet, but didn't find. This task may be big enough, so I'd like to see a link to some example in the internet (youtube, or stackoverflow, or github, etc).







python django






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 7 at 17:48









Alex Kondrashov

135




135












  • yeah, i understand that my question is complicated. But I don't even have an idea where to start.
    – Alex Kondrashov
    Nov 7 at 17:56






  • 3




    But this is literally the thing that Django was designed for, and there are thousands of tutorials telling you how to create your own blog with links to individual pages.
    – Daniel Roseman
    Nov 7 at 17:58






  • 1




    "I've searched the solution of my problem in the internet, but didn't find." Have you done Django's (very good) tutorial? It definitely covers this.
    – Chris
    Nov 7 at 18:01


















  • yeah, i understand that my question is complicated. But I don't even have an idea where to start.
    – Alex Kondrashov
    Nov 7 at 17:56






  • 3




    But this is literally the thing that Django was designed for, and there are thousands of tutorials telling you how to create your own blog with links to individual pages.
    – Daniel Roseman
    Nov 7 at 17:58






  • 1




    "I've searched the solution of my problem in the internet, but didn't find." Have you done Django's (very good) tutorial? It definitely covers this.
    – Chris
    Nov 7 at 18:01
















yeah, i understand that my question is complicated. But I don't even have an idea where to start.
– Alex Kondrashov
Nov 7 at 17:56




yeah, i understand that my question is complicated. But I don't even have an idea where to start.
– Alex Kondrashov
Nov 7 at 17:56




3




3




But this is literally the thing that Django was designed for, and there are thousands of tutorials telling you how to create your own blog with links to individual pages.
– Daniel Roseman
Nov 7 at 17:58




But this is literally the thing that Django was designed for, and there are thousands of tutorials telling you how to create your own blog with links to individual pages.
– Daniel Roseman
Nov 7 at 17:58




1




1




"I've searched the solution of my problem in the internet, but didn't find." Have you done Django's (very good) tutorial? It definitely covers this.
– Chris
Nov 7 at 18:01




"I've searched the solution of my problem in the internet, but didn't find." Have you done Django's (very good) tutorial? It definitely covers this.
– Chris
Nov 7 at 18:01












2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










In your views.py define a function that would get one object from the primary key it receives.



def show_one_item(request, pk):
headline_news = Newsform.objects.get(pk=pk) # returns only one object
context = {
'headline_news': headline_news
}
return render(request, 'blog/new_template.html', context) # Write a new template to view your news.


Add this to your urls.py



urlpatterns = [
path('', views.show_content_from_database, name='show_content_from_database'),
path('news/<pk:pk>', show_one_item, name="show_one_item")
]


And once you write your new_template to fit the function. You have unique urls for each of your news item.



An example of your new_template.html might look like.



{% extends 'base.html' %}
<div class="container">

<p>{{ headline_news.headline }}</p>
<p>{{ headline_news.description }}</p>
<p>{{ headline_news.content }}</p>

</div>


Now, You can go to ../news/1(assuming you didn't mess up django's default behaviour) for viewing your first news item. ../news/2 for second and so on... And later on learn how to do it with slugs to make your urls look realistic.






share|improve this answer






























    up vote
    1
    down vote













    since you are coding a blog app, using a slug as your unique identifier is cool. A "slug" is the part of a URL which identifies a page using human-readable keywords, usually based on the title of the page. You can check out this blog article https://keyerror.com/blog/automatically-generating-unique-slugs-in-django



    Here is a quick explanation using your available code



    Your Models.py



    from django.db import models

    class Newsform(models.Model):
    headline = models.CharField(max_length=50)
    slug = models.SlugField(unique=True)
    description = models.CharField(max_length=100, default='')
    content = models.CharField(max_length=100, default='')
    image = models.ImageField(upload_to='news_image', blank=True)


    Views.py



    from django.shortcuts import render, get_object_or_404
    from blog.models import Newsform

    def show_content_from_database(request, slug):
    headline_news= get_object_or_404(Newsform, slug=slug)
    context = {
    'headline_news': headline_news
    }
    return render(request, 'blog/index.html', context)


    Urls.py



    from django.urls import path
    from . import views

    urlpatterns = [
    path('blog/<slug:slug>', views.show_content_from_database,
    name='show_content_from_database'),
    ]


    Your Template.html



    {% extends 'base.html' %}
    <p>{{ headline_news.headline }}</p>
    {% endblock %}


    Since you are getting a particular blog page, there is no need for this {% for headline in headline_news %}.



    Good Luck!!






    share|improve this answer



















    • 1




      While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
      – aliak
      Nov 7 at 20:36










    • Ok @alliak. You know he said he will to see a link to some examples regarding his problem. Let me do some edition then
      – Transformer
      Nov 8 at 7:41











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194989%2fhow-to-create-unique-urls-in-django%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    In your views.py define a function that would get one object from the primary key it receives.



    def show_one_item(request, pk):
    headline_news = Newsform.objects.get(pk=pk) # returns only one object
    context = {
    'headline_news': headline_news
    }
    return render(request, 'blog/new_template.html', context) # Write a new template to view your news.


    Add this to your urls.py



    urlpatterns = [
    path('', views.show_content_from_database, name='show_content_from_database'),
    path('news/<pk:pk>', show_one_item, name="show_one_item")
    ]


    And once you write your new_template to fit the function. You have unique urls for each of your news item.



    An example of your new_template.html might look like.



    {% extends 'base.html' %}
    <div class="container">

    <p>{{ headline_news.headline }}</p>
    <p>{{ headline_news.description }}</p>
    <p>{{ headline_news.content }}</p>

    </div>


    Now, You can go to ../news/1(assuming you didn't mess up django's default behaviour) for viewing your first news item. ../news/2 for second and so on... And later on learn how to do it with slugs to make your urls look realistic.






    share|improve this answer



























      up vote
      1
      down vote



      accepted










      In your views.py define a function that would get one object from the primary key it receives.



      def show_one_item(request, pk):
      headline_news = Newsform.objects.get(pk=pk) # returns only one object
      context = {
      'headline_news': headline_news
      }
      return render(request, 'blog/new_template.html', context) # Write a new template to view your news.


      Add this to your urls.py



      urlpatterns = [
      path('', views.show_content_from_database, name='show_content_from_database'),
      path('news/<pk:pk>', show_one_item, name="show_one_item")
      ]


      And once you write your new_template to fit the function. You have unique urls for each of your news item.



      An example of your new_template.html might look like.



      {% extends 'base.html' %}
      <div class="container">

      <p>{{ headline_news.headline }}</p>
      <p>{{ headline_news.description }}</p>
      <p>{{ headline_news.content }}</p>

      </div>


      Now, You can go to ../news/1(assuming you didn't mess up django's default behaviour) for viewing your first news item. ../news/2 for second and so on... And later on learn how to do it with slugs to make your urls look realistic.






      share|improve this answer

























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        In your views.py define a function that would get one object from the primary key it receives.



        def show_one_item(request, pk):
        headline_news = Newsform.objects.get(pk=pk) # returns only one object
        context = {
        'headline_news': headline_news
        }
        return render(request, 'blog/new_template.html', context) # Write a new template to view your news.


        Add this to your urls.py



        urlpatterns = [
        path('', views.show_content_from_database, name='show_content_from_database'),
        path('news/<pk:pk>', show_one_item, name="show_one_item")
        ]


        And once you write your new_template to fit the function. You have unique urls for each of your news item.



        An example of your new_template.html might look like.



        {% extends 'base.html' %}
        <div class="container">

        <p>{{ headline_news.headline }}</p>
        <p>{{ headline_news.description }}</p>
        <p>{{ headline_news.content }}</p>

        </div>


        Now, You can go to ../news/1(assuming you didn't mess up django's default behaviour) for viewing your first news item. ../news/2 for second and so on... And later on learn how to do it with slugs to make your urls look realistic.






        share|improve this answer














        In your views.py define a function that would get one object from the primary key it receives.



        def show_one_item(request, pk):
        headline_news = Newsform.objects.get(pk=pk) # returns only one object
        context = {
        'headline_news': headline_news
        }
        return render(request, 'blog/new_template.html', context) # Write a new template to view your news.


        Add this to your urls.py



        urlpatterns = [
        path('', views.show_content_from_database, name='show_content_from_database'),
        path('news/<pk:pk>', show_one_item, name="show_one_item")
        ]


        And once you write your new_template to fit the function. You have unique urls for each of your news item.



        An example of your new_template.html might look like.



        {% extends 'base.html' %}
        <div class="container">

        <p>{{ headline_news.headline }}</p>
        <p>{{ headline_news.description }}</p>
        <p>{{ headline_news.content }}</p>

        </div>


        Now, You can go to ../news/1(assuming you didn't mess up django's default behaviour) for viewing your first news item. ../news/2 for second and so on... And later on learn how to do it with slugs to make your urls look realistic.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 7 at 19:10

























        answered Nov 7 at 18:02









        Vineeth Sai

        2,22431023




        2,22431023
























            up vote
            1
            down vote













            since you are coding a blog app, using a slug as your unique identifier is cool. A "slug" is the part of a URL which identifies a page using human-readable keywords, usually based on the title of the page. You can check out this blog article https://keyerror.com/blog/automatically-generating-unique-slugs-in-django



            Here is a quick explanation using your available code



            Your Models.py



            from django.db import models

            class Newsform(models.Model):
            headline = models.CharField(max_length=50)
            slug = models.SlugField(unique=True)
            description = models.CharField(max_length=100, default='')
            content = models.CharField(max_length=100, default='')
            image = models.ImageField(upload_to='news_image', blank=True)


            Views.py



            from django.shortcuts import render, get_object_or_404
            from blog.models import Newsform

            def show_content_from_database(request, slug):
            headline_news= get_object_or_404(Newsform, slug=slug)
            context = {
            'headline_news': headline_news
            }
            return render(request, 'blog/index.html', context)


            Urls.py



            from django.urls import path
            from . import views

            urlpatterns = [
            path('blog/<slug:slug>', views.show_content_from_database,
            name='show_content_from_database'),
            ]


            Your Template.html



            {% extends 'base.html' %}
            <p>{{ headline_news.headline }}</p>
            {% endblock %}


            Since you are getting a particular blog page, there is no need for this {% for headline in headline_news %}.



            Good Luck!!






            share|improve this answer



















            • 1




              While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
              – aliak
              Nov 7 at 20:36










            • Ok @alliak. You know he said he will to see a link to some examples regarding his problem. Let me do some edition then
              – Transformer
              Nov 8 at 7:41















            up vote
            1
            down vote













            since you are coding a blog app, using a slug as your unique identifier is cool. A "slug" is the part of a URL which identifies a page using human-readable keywords, usually based on the title of the page. You can check out this blog article https://keyerror.com/blog/automatically-generating-unique-slugs-in-django



            Here is a quick explanation using your available code



            Your Models.py



            from django.db import models

            class Newsform(models.Model):
            headline = models.CharField(max_length=50)
            slug = models.SlugField(unique=True)
            description = models.CharField(max_length=100, default='')
            content = models.CharField(max_length=100, default='')
            image = models.ImageField(upload_to='news_image', blank=True)


            Views.py



            from django.shortcuts import render, get_object_or_404
            from blog.models import Newsform

            def show_content_from_database(request, slug):
            headline_news= get_object_or_404(Newsform, slug=slug)
            context = {
            'headline_news': headline_news
            }
            return render(request, 'blog/index.html', context)


            Urls.py



            from django.urls import path
            from . import views

            urlpatterns = [
            path('blog/<slug:slug>', views.show_content_from_database,
            name='show_content_from_database'),
            ]


            Your Template.html



            {% extends 'base.html' %}
            <p>{{ headline_news.headline }}</p>
            {% endblock %}


            Since you are getting a particular blog page, there is no need for this {% for headline in headline_news %}.



            Good Luck!!






            share|improve this answer



















            • 1




              While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
              – aliak
              Nov 7 at 20:36










            • Ok @alliak. You know he said he will to see a link to some examples regarding his problem. Let me do some edition then
              – Transformer
              Nov 8 at 7:41













            up vote
            1
            down vote










            up vote
            1
            down vote









            since you are coding a blog app, using a slug as your unique identifier is cool. A "slug" is the part of a URL which identifies a page using human-readable keywords, usually based on the title of the page. You can check out this blog article https://keyerror.com/blog/automatically-generating-unique-slugs-in-django



            Here is a quick explanation using your available code



            Your Models.py



            from django.db import models

            class Newsform(models.Model):
            headline = models.CharField(max_length=50)
            slug = models.SlugField(unique=True)
            description = models.CharField(max_length=100, default='')
            content = models.CharField(max_length=100, default='')
            image = models.ImageField(upload_to='news_image', blank=True)


            Views.py



            from django.shortcuts import render, get_object_or_404
            from blog.models import Newsform

            def show_content_from_database(request, slug):
            headline_news= get_object_or_404(Newsform, slug=slug)
            context = {
            'headline_news': headline_news
            }
            return render(request, 'blog/index.html', context)


            Urls.py



            from django.urls import path
            from . import views

            urlpatterns = [
            path('blog/<slug:slug>', views.show_content_from_database,
            name='show_content_from_database'),
            ]


            Your Template.html



            {% extends 'base.html' %}
            <p>{{ headline_news.headline }}</p>
            {% endblock %}


            Since you are getting a particular blog page, there is no need for this {% for headline in headline_news %}.



            Good Luck!!






            share|improve this answer














            since you are coding a blog app, using a slug as your unique identifier is cool. A "slug" is the part of a URL which identifies a page using human-readable keywords, usually based on the title of the page. You can check out this blog article https://keyerror.com/blog/automatically-generating-unique-slugs-in-django



            Here is a quick explanation using your available code



            Your Models.py



            from django.db import models

            class Newsform(models.Model):
            headline = models.CharField(max_length=50)
            slug = models.SlugField(unique=True)
            description = models.CharField(max_length=100, default='')
            content = models.CharField(max_length=100, default='')
            image = models.ImageField(upload_to='news_image', blank=True)


            Views.py



            from django.shortcuts import render, get_object_or_404
            from blog.models import Newsform

            def show_content_from_database(request, slug):
            headline_news= get_object_or_404(Newsform, slug=slug)
            context = {
            'headline_news': headline_news
            }
            return render(request, 'blog/index.html', context)


            Urls.py



            from django.urls import path
            from . import views

            urlpatterns = [
            path('blog/<slug:slug>', views.show_content_from_database,
            name='show_content_from_database'),
            ]


            Your Template.html



            {% extends 'base.html' %}
            <p>{{ headline_news.headline }}</p>
            {% endblock %}


            Since you are getting a particular blog page, there is no need for this {% for headline in headline_news %}.



            Good Luck!!







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 8 at 11:08

























            answered Nov 7 at 18:48









            Transformer

            2,39411223




            2,39411223








            • 1




              While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
              – aliak
              Nov 7 at 20:36










            • Ok @alliak. You know he said he will to see a link to some examples regarding his problem. Let me do some edition then
              – Transformer
              Nov 8 at 7:41














            • 1




              While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
              – aliak
              Nov 7 at 20:36










            • Ok @alliak. You know he said he will to see a link to some examples regarding his problem. Let me do some edition then
              – Transformer
              Nov 8 at 7:41








            1




            1




            While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
            – aliak
            Nov 7 at 20:36




            While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
            – aliak
            Nov 7 at 20:36












            Ok @alliak. You know he said he will to see a link to some examples regarding his problem. Let me do some edition then
            – Transformer
            Nov 8 at 7:41




            Ok @alliak. You know he said he will to see a link to some examples regarding his problem. Let me do some edition then
            – Transformer
            Nov 8 at 7:41


















             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194989%2fhow-to-create-unique-urls-in-django%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini