String with 'f' prefix not work with python2.7 by run examples
howmp opened this issue · comments
- DRF OpenAPI version: 1.0.0
- Python version: 2.7.11
- Operating System: windows
Description
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(f'{API_PREFIX}/schema/', MySchemaView.as_view(), name='api_schema'),
url(f'{API_PREFIX}/snippets/', include('snippets.urls')),
]
String with 'f' prefix not work in python2.7
What I Did
python examples/manage.py runserver
f strings were added in Python3.6.
While f strings are really nice I think the best thing to update the docs to change these to raw strings instead.
@howmp would you be interested in submitting a PR updating it to raw regex in the docs?
+1, does not work with Python 2.7