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

  • Home
  • SEARCH
  • 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 7562925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:32:02+00:00 2026-05-30T13:32:02+00:00

For Django 1.3.1, where is the source code that makes it possible to do

  • 0

For Django 1.3.1, where is the source code that makes it possible to do a from django.conf.urls import patterns ?

In the Django 1.3.1 source code for the django.conf.urls package, __init__.py is empty, so there is no code or __all__ variable. The code for the patterns() function appears to be in defaults.py which does have an __all__ variable.

How does Python end up including a pattern() function in the django.conf.urls package?

  • 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-30T13:32:03+00:00Added an answer on May 30, 2026 at 1:32 pm

    I figured out my problem:

    1. I discovered I was wrong about thinking I was successfully running
      from django.conf.urls import pattern
      in Django 1.3.1. The code was actually
      from django.conf.urls.defaults import pattern

    2. There are two different Django tutorials:

      • https://docs.djangoproject.com/en/dev/intro/tutorial01/ – this is the one that shows up first in a google search for “django tutorial”. However, this is for the Django “dev” version, not for Django 1.3.1. It uses
        from django.conf.urls import pattern
      • https://docs.djangoproject.com/en/1.3/intro/tutorial01/ – this is the one for Django 1.3.1, and uses from django.conf.urls.defaults import pattern
    3. I opened Django ticket 17770 for this, and it was closed as a duplicate of ticket 16932. Ticket 16933 was opened and fixed to remedy the confusion of the different versions of documentation/tutorials. However, it wasn’t apparent to me. I added a screenshot to 16933 showing how to see which version of the docs you are reading (and to select a different version).
      enter image description here

    4. I was confused because I thought I was using
      from django.conf.urls import...
      as the tutorial states, and I thought that code was working. But in fact I was using the urls.py code that gets created with django-admin.py startproject, and this code is correctly using
      from django.conf.urls.defaults import...
      for Django 1.3.1. That worked.

    5. My confusion surfaced in tutorial 4, when I copied the polls/urls.py code from the tutorial for the dev version. That code is from django.conf.urls import... and it causes:

      Django Version: 1.3.1
      Exception Type: ImportError
      Exception Value: cannot import name patterns
      Exception Location: /…/django_tutorial_1/polls/urls.py in , line 1

    jdi, thanks for your help. Although your answer wasn’t exactly what I was looking for, it encouraged me to keep going. My question stated a false fact, which I later discovered (per #1 above).

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

Sidebar

Related Questions

I have a Django app that gets it's data completely from an external source
Possible Duplicate: Understanding Python decorators I was reading a django app source code where
A specific example: becoming familiar with django's project source code (core, contrib, utils, etc.).
I'm especially interested in solutions with source code available (Django independency is a plus,
Django has a number of open source projects that tackle one of the framework's
Update : Reading directly the django source code i got one undocumented missing piece
I have a simple set of urls in a Django url conf file which
I was browsing the Django source code and I saw this function: def colorize(text='',
As far as I know (I haven't looked into the django's admin source code
I'm trying to understand how session works in Django. Looking at the source code

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.