Is it better to use path() or url() in urls.py for django 2.0?

From Django documentation for url url(regex, view, kwargs=None, name=None) This function is an alias to django.urls.re_path(). It’s likely to be deprecated in a future release. Key difference between path and re_path is that path uses route without regex You can use re_path for complex regex calls and use just path for simpler lookups

OperationalError: database is locked

From django doc: SQLite is meant to be a lightweight database, and thus can’t support a high level of concurrency. OperationalError: database is locked errors indicate that your application is experiencing more concurrency than sqlite can handle in default configuration. This error means that one thread or process has an exclusive lock on the database … Read more

What does this Django regular expression mean? `?P`

In django, named capturing groups are passed to your view as keyword arguments. Unnamed capturing groups (just a parenthesis) are passed to your view as arguments. The ?P is a named capturing group, as opposed to an unnamed capturing group. http://docs.python.org/library/re.html (?P<name>…) Similar to regular parentheses, but the substring matched by the group is accessible within … Read more

ImportError: No module named ‘django.core.urlresolvers’

Django 2.0 removes the django.core.urlresolvers module, which was moved to django.urls in version 1.10. You should change any import to use django.urls instead, like this: Note that Django 2.0 removes some features that previously were in django.core.urlresolvers, so you might have to make some more changes before your code works. See the features deprecated in 1.9 for details on those additional changes.