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

Update urls.py to new urlpatterns format #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FFX01
Copy link

@FFX01 FFX01 commented May 5, 2016

urlpatterns = patterns('',)

Is deprecated as of Django 1.10. I see no reason to not change it now as I tested and it doesn't seem to disrupt the function of the application at all.

```
urlpatterns = patterns('',)
```
Is deprecated as of Django 1.10. I see no reason to not change it now as I tested and it doesn't seem to disrupt the function of the application at all.
@joshkehn
Copy link
Contributor

Concern here might be compatibility with previous versions of Django. What about:

wrap_patterns = False
try:
    from django.conf.urls import patterns #...
except ImportError:
    wrap_patterns = True
    from django.conf.urls.defaults import patterns #...

if wrap_patterns:
    urlpatterns = patterns('', *urlpatterns)

@andrijan
Copy link

@joshkehn Shouldn't users with old versions of Django use and old version of Swagger then?

@FFX01
Copy link
Author

FFX01 commented Sep 26, 2016

@joshkehn
I don't think that's an issue here as the oldest officially supported version of Django is 1.8 which uses the new way of declaring url patterns. That is, unless we want to support deprecated versions. I believe #116 is also trying to fix this same issue. I think that the solution offered there is unnecessary unless we plan to support deprecated versions.

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.

3 participants