Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include namespace with the urlpatterns #102

Conversation

dnaranjo89
Copy link

Otherwise update the doc to include the namespace (#103):

import notifications

urlpatterns = patterns('',
    ...
    url('^inbox/notifications/', include(notifications.urls, namespace='notifications')),
    ...
)

@yangyubo
Copy link
Member

@zhang-z Could you please review this PR, I haven't touch Django for a very long time…

@zhang-z zhang-z mentioned this pull request Dec 17, 2015
@zhang-z
Copy link
Contributor

zhang-z commented Dec 17, 2015

Hi @dnaranjo89 , thanks for the update.

The 3-tuple is deprecated since Django 1.9:

Support for the app_name argument is deprecated and will be removed in Django 2.0. Specify the app_name as explained in URL namespaces and included URLconfs instead.

Support for passing a 3-tuple is also deprecated and will be removed in Django 2.0. Pass a 2-tuple containing the pattern list and application namespace, and use the namespace argument instead.

For instance namespace, the more recommended way would be to specify it in include(notifications.urls, namespace='notifications'). For application namespace, in pull request #104, I have added 'app_name' to notifications/urls.py, which will apply to version 1.9 and above. For version 1.8 and below, we can still specify it in include().

@dnaranjo89
Copy link
Author

Perfect, thanks for the fast update!

@zhang-z zhang-z closed this Dec 17, 2015
nemesifier added a commit that referenced this pull request Apr 28, 2019
nemesifier added a commit that referenced this pull request Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants