[Django] #25066: Generated code contains deprecated function, `django.conf.urls.patterns()`

29 views
Skip to first unread message

Django

unread,
Jul 6, 2015, 4:00:13 AM7/6/15
to django-...@googlegroups.com
#25066: Generated code contains deprecated function, `django.conf.urls.patterns()`
----------------------------+----------------------------
Reporter: lym | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.8
Severity: Normal | Keywords: generated code
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+----------------------------
The `<project>/urls.py` file generated by running the `startproject`
management command contains an invocation of the above function.That
function appears to have been deprecated as per
(https://docs.djangoproject.com/en/1.8/ref/urls/) document.

Am running django 1.8.2 final 0 on Ubuntu 14.04 LTS

--
Ticket URL: <https://code.djangoproject.com/ticket/25066>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 6, 2015, 4:11:23 AM7/6/15
to django-...@googlegroups.com
#25066: Generated code contains deprecated function, `django.conf.urls.patterns()`
--------------------------------+--------------------------------------
Reporter: lym | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 1.8
Severity: Normal | Resolution: worksforme

Keywords: generated code | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by bmispelon):

* status: new => closed
* needs_docs: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_better_patch: => 0


Comment:

Hi,

I can't reproduce the behavior you're describing: when I generate a new
project with Django 1.8.2, the `urls.py` file has no mention of
`patterns()`.

Can you make sure you're using the correct version?

There were some mentions of this function in the comments at the top of
the file but those were fixed in #24635 (and the changes are already part
of Django 1.8.2).

Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/25066#comment:1>

Django

unread,
Jul 6, 2015, 5:19:52 AM7/6/15
to django-...@googlegroups.com
#25066: Generated code contains deprecated function, `django.conf.urls.patterns()`
--------------------------------+--------------------------------------
Reporter: lym | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 1.8
Severity: Normal | Resolution: worksforme

Keywords: generated code | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by lym):

* Attachment "django-admin_issue.txt" added.

Django

unread,
Jul 6, 2015, 5:26:20 AM7/6/15
to django-...@googlegroups.com
#25066: Generated code contains deprecated function, `django.conf.urls.patterns()`
--------------------------------+--------------------------------------
Reporter: lym | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 1.8
Severity: Normal | Resolution: worksforme

Keywords: generated code | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by lym):

Below is the sequence of commands I ran and it still happens for me, after
installing the latest django with pip v7:

$ mkdir issue_tester
$ cd issue_tester/
$ virtualenv -p /usr/bin/python
$ .env/bin/pip3 install --upgrade pip
$ .env/bin/pip3 install django
$ vim .env/lib/python3.4/site-packages/django/__init__.py # to confirm
django is 1.8.2
$ django-admin startproject issue_tester .
$ vim issue_tester/urls.py # the contents of this file are in the
attached file. You'll notice patterns() is imported and invoked

Am I just doing something wrong?

--
Ticket URL: <https://code.djangoproject.com/ticket/25066#comment:2>

Django

unread,
Jul 6, 2015, 5:29:39 AM7/6/15
to django-...@googlegroups.com
#25066: Generated code contains deprecated function, `django.conf.urls.patterns()`
--------------------------------+--------------------------------------
Reporter: lym | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 1.8
Severity: Normal | Resolution: worksforme

Keywords: generated code | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by bmispelon):

I think you should be using `.env/bin/django-admin` rather than simply
`django-admin`.

It seems that you have an older version of Django installed globally. You
can confirm by doing `django-admin --version`.

--
Ticket URL: <https://code.djangoproject.com/ticket/25066#comment:3>

Django

unread,
Jul 6, 2015, 5:37:20 AM7/6/15
to django-...@googlegroups.com
#25066: Generated code contains deprecated function, `django.conf.urls.patterns()`
--------------------------------+--------------------------------------
Reporter: lym | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: generated code | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by lym):

* resolution: worksforme => fixed


Comment:

Yes @bmispelon, you're right. I was referencing an older `django-admin`.
Works fine now. I should've double-checked. Sorry about that and thanks
for your time.

--
Ticket URL: <https://code.djangoproject.com/ticket/25066#comment:4>

Reply all
Reply to author
Forward
0 new messages