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 8346997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:12:28+00:00 2026-06-09T07:12:28+00:00

i get : Using the URLconf defined in blog.urls, Django tried these URL patterns,

  • 0

i get :
Using the URLconf defined in blog.urls, Django tried these URL patterns, in this order:
^ ^$
^ ^/(?P[a-zA-Z0-9]+) [name=’view_blog_post’]
The current URL, duzeltme-yazisi/, didn’t match any of these.

this error.
here some outputs :

urls.py (in project folder) :

from django.conf.urls import patterns, include, url

urlpatterns = patterns('',
    url(r'^', include('userside.urls')),

)

urls.py (in app’s folder) :

from django.conf.urls import patterns, include, url

urlpatterns = patterns('userside.views',
    url(r'^$','index'),
    url(r'^/(?P<postslug>[^\.]+)','userside.views.singlePost',name='view_blog_post'),
)

views.py :

from userside.models import Post
from django.shortcuts import render_to_response
from django.template import RequestContext


def index(request):
    post_list = Post.objects.all()
    return render_to_response('userside/index.html',
                              {'post_list':post_list},
                  context_instance = RequestContext(request))

def singlePost(request,postslug):
    post = Post.objects.get(slug=postslug)
    context = {'post':post}
    return render_to_response('userside/detail.html',context,context_instance = RequestContext(request))

models.py :

from django.db import models
#from django.utils import timezone
from django.db.models import permalink

class Post(models.Model):
    title = models.CharField(max_length = 100)
#    date  = models.DateTimeField(auto_now_add=True)
    text  = models.TextField()
    slug = models.SlugField(unique=True)

    def __unicode__(self):
    return self.title

    @permalink
    def get_absolute_url(self):
    return ('view_blog_post',None, {'postslug':self.slug})

and here is my index.html template file :

<html>
<head>
        <title>Welcome</title>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/index.css" />
</head>
<body>
<h1>Hello Mars</h1>
<br>
{% if post_list %}
    {% for x in post_list %}
        <p><a href="/{{ x.slug }}/">{{ x.title }}</a></p>
        <p>{{ x.text }}</p>
        <hr>
    {% endfor %}
{% else %}
    <div class="center">No records! ( but looks like code works correctly!)</div>
{% endif %}
</body>
</html>

Django version : 1.4

whats wrong here ? :/

thank you

  • 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-06-09T07:12:30+00:00Added an answer on June 9, 2026 at 7:12 am

    project – urls.py

    url(r'^$', include('userside.urls')),
    

    userside – urls.py

    url(r'^(?P<postslug>[-\w]+)/$',
        # ../gis-grundlagen/
        view = 'singlePost',
        name = 'userside-single-post',
    ),
    

    userside – views.py

    def singlePost(request, postslug):
        post = get_object_or_404(Post, slug=postslug)
        context = {'post':post}
        return render_to_response('userside/detail.html',context,context_instance = RequestContext(request))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In browser I get: Request URL: http://xxxxxx:8000/person/test/ Using the URLconf defined in person.urls, Django
Why I get this error? Page not found (404) Using the URLconf defined in
I am doing an http get using the url http://localhost/add?add_key[0][key]=1234&add_key[0][id]=1. I have a rails
I'm on my first Django blog and when trying to get the posts by
In my Django project, I used to have a single URLConf, urls.py at the
I've switched to Django 1.3 in order to get pagination for my date based
I'm trying to play a playlist I get using the MediaStore provider. However, when
Using get/set seems to be a common practice in Java (for various reasons), but
I'm using get_by_id() to read entities from NDB and I do not get it
I just get started using BDD in Rails application, but I'm not sure what

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.