#18915 closed Cleanup/optimization (fixed)
Unused import in resulting polls/urls.py module
| Reported by: | Owned by: | nickmartini | |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Normal | Keywords: | cleanup unused import |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
There's an unused import in the resulting polls.urls module in section https://docs.djangoproject.com/en/dev/intro/tutorial03/#decoupling-the-urlconfs .
Now that we've decoupled that, we need to decouple the polls.urls URLconf by removing the leading "polls/" from each line, and removing the lines registering the admin site. Your polls/urls.py file should now look like this:
from django.conf.urls import patterns, include, url
urlpatterns = patterns('polls.views',
url(r'^$', 'index'),
url(r'^(?P<poll_id>\d+)/$', 'detail'),
url(r'^(?P<poll_id>\d+)/results/$', 'results'),
url(r'^(?P<poll_id>\d+)/vote/$', 'vote'),
)
The imported 'include' will never be used.
Change History (8)
comment:1 by , 13 years ago
| Easy pickings: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 13 years ago
| Owner: | changed from to |
|---|
comment:3 by , 13 years ago
comment:4 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:6 by , 13 years ago
| Has patch: | set |
|---|
Oh, I had assigned this to myself and did a pull request: https://github.com/django/django/pull/341
I see Alex submitted a patch to remove the include import, but I also updated the associated docs text in my patch so hopefully that's of use.
Oops, already sent PR.
https://github.com/django/django/pull/336