diff --git a/README.md b/README.md index cd25412..0e1d30d 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ A simple Django web app for searching the Paradise Papers dataset backed by Neo4 # Requirements -- Python 3.7+ -- Django 2.2+ -- neo4j 5.x, 4.4 -- django-neomodel 0.1.1 +- Python 3.8+ +- Django 4.2.8+ (LTS) +- neo4j 5.x, 4.4 (LTS) +- django-neomodel 0.2.0 # Quickstart diff --git a/docs/tutorial/part03.rst b/docs/tutorial/part03.rst index d1138ca..cf8fd8d 100644 --- a/docs/tutorial/part03.rst +++ b/docs/tutorial/part03.rst @@ -25,7 +25,7 @@ of it is: :: Now we need to create a file called `urls.py` inside the application we just created. Right now we are only going to add the following code:: - from django.conf.urls import url + from django.urls import path urlpatterns = [] @@ -33,15 +33,16 @@ As we go on in this tutorial, we will start adding the endpoint urls, but for no have the empty urlpattern list. The next step is to register the fetch_api URLconf into the root project URLconf. We need to open -the file paradise_papers_search/urls.py. Afterwards, we have to add ``url(r'^fetch/', +the file paradise_papers_search/urls.py. Afterwards, we have to add ``path('fetch/', include('fetch_api.urls', namespace='fetch_api')),`` inside the urlpatterns list. After completing these steps the file should look like this:: - from django.conf.urls import url, include from django.contrib import admin from - django.views.generic import TemplateView + from django.urls import include, path + from django.contrib import admin + from django.views.generic import TemplateView - urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', - TemplateView.as_view(template_name='index.html'), name='index'), url(r'^fetch/', + urlpatterns = [ path('admin/', admin.site.urls), path('', + TemplateView.as_view(template_name='index.html'), name='index'), path('fetch/', include('fetch_api.urls', namespace='fetch_api')), ] diff --git a/docs/tutorial/part05.rst b/docs/tutorial/part05.rst index cd2630b..7e37d58 100644 --- a/docs/tutorial/part05.rst +++ b/docs/tutorial/part05.rst @@ -47,11 +47,11 @@ Let's clean our ``fetch_api/views.py`` file and add the following code:: Now we create this file ``fetch_api/urls.py`` and fill it with this:: - from django.conf.urls import url + from django.urls import path from .views import GetNodesData urlpatterns = [ - url(r'^nodes[/]?$', GetNodesData.as_view(), name='get_nodes_data'), + path('nodes/', GetNodesData.as_view(), name='get_nodes_data'), ] Now we can hit the endpoint with a method of our preference, for this example, we are going to use @@ -107,7 +107,7 @@ When we finish our ``fetch_api/views.py`` file should look like this:: And the ``fetch_api/urls.py`` should look like this:: - from django.conf.urls import url + from django.urls import path from .views import ( GetNodesCount, GetNodesData, @@ -118,10 +118,10 @@ And the ``fetch_api/urls.py`` should look like this:: ) urlpatterns = [ - url(r'^count[/]?$', GetNodesCount.as_view(), name='get_nodes_count'), - url(r'^nodes[/]?$', GetNodesData.as_view(), name='get_nodes_data'), - url(r'^node[/]?$', GetNodeData.as_view(), name='get_node_data'), - url(r'^countries[/]?$', GetCountries.as_view(), name='get_countries'), - url(r'^jurisdictions[/]?$', GetJurisdictions.as_view(), name='get_jurisdictions'), - url(r'^datasource[/]?$', GetDataSource.as_view(), name='get_data_source'), + path('count/', GetNodesCount.as_view(), name='get_nodes_count'), + path('nodes/', GetNodesData.as_view(), name='get_nodes_data'), + path('node/', GetNodeData.as_view(), name='get_node_data'), + path('countries/', GetCountries.as_view(), name='get_countries'), + path('jurisdictions/', GetJurisdictions.as_view(), name='get_jurisdictions'), + path('datasource/', GetDataSource.as_view(), name='get_data_source'), ] diff --git a/paradise_papers_search/fetch_api/urls.py b/paradise_papers_search/fetch_api/urls.py index 1b3070f..58fc159 100644 --- a/paradise_papers_search/fetch_api/urls.py +++ b/paradise_papers_search/fetch_api/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import url +from django.urls import path from .views import ( GetNodesCount, @@ -11,10 +11,10 @@ urlpatterns = [ - url(r'^count[/]?$', GetNodesCount.as_view(), name='get_nodes_count'), - url(r'^nodes[/]?$', GetNodesData.as_view(), name='get_nodes_data'), - url(r'^node[/]?$', GetNodeData.as_view(), name='get_node_data'), - url(r'^countries[/]?$', GetCountries.as_view(), name='get_countries'), - url(r'^jurisdictions[/]?$', GetJurisdictions.as_view(), name='get_jurisdictions'), - url(r'^datasource[/]?$', GetDataSource.as_view(), name='get_data_source'), + path("count/", GetNodesCount.as_view(), name="get_nodes_count"), + path("nodes/", GetNodesData.as_view(), name="get_nodes_data"), + path("node/", GetNodeData.as_view(), name="get_node_data"), + path("countries/", GetCountries.as_view(), name="get_countries"), + path("jurisdictions/", GetJurisdictions.as_view(), name="get_jurisdictions"), + path("datasource/", GetDataSource.as_view(), name="get_data_source"), ] diff --git a/paradise_papers_search/papers.db b/paradise_papers_search/papers.db index 9afda68..7b2ff98 100644 Binary files a/paradise_papers_search/papers.db and b/paradise_papers_search/papers.db differ diff --git a/paradise_papers_search/paradise_papers_search/urls.py b/paradise_papers_search/paradise_papers_search/urls.py index eb69709..efd0e02 100644 --- a/paradise_papers_search/paradise_papers_search/urls.py +++ b/paradise_papers_search/paradise_papers_search/urls.py @@ -5,20 +5,21 @@ Examples: Function views 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') + 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include - 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ -from django.conf.urls import url, include + +from django.urls import include, path from django.views.generic import TemplateView from django.contrib import admin urlpatterns = [ - url(r'^$', TemplateView.as_view(template_name='index.html'), name='index'), - url(r'^fetch/', include('fetch_api.urls')), - url(r"^admin/", admin.site.urls) + path("", TemplateView.as_view(template_name="index.html"), name="index"), + path("fetch/", include("fetch_api.urls")), + path("admin/", admin.site.urls), ] diff --git a/paradise_papers_search/templates/base.html b/paradise_papers_search/templates/base.html index bbf2a9b..462423f 100644 --- a/paradise_papers_search/templates/base.html +++ b/paradise_papers_search/templates/base.html @@ -1,4 +1,4 @@ -{% load staticfiles %} +{% load static %} diff --git a/requirements.txt b/requirements.txt index 2c631f0..f43726b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,4 @@ -django==2.2.24 gunicorn==20.0.4 -django-neomodel==0.1.1 -neomodel==5.1.0 -djangorestframework==3.11.2 +django-neomodel==0.2.0 +djangorestframework==3.15.1 whitenoise==3.3.1