Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25066 closed Bug (fixed)

Generated code contains deprecated function, `django.conf.urls.patterns()`

Reported by: salym Owned by: nobody
Component: Utilities Version: 1.8
Severity: Normal Keywords: generated code
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Attachments (1)

django-admin_issue.txt (281 bytes ) - added by salym 9 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Baptiste Mispelon, 9 years ago

Resolution: worksforme
Status: newclosed

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.

by salym, 9 years ago

Attachment: django-admin_issue.txt added

comment:2 by salym, 9 years ago

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?

comment:3 by Baptiste Mispelon, 9 years ago

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.

comment:4 by salym, 9 years ago

Resolution: worksformefixed

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.

Note: See TracTickets for help on using tickets.
Back to Top