diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab45e9392..8f1e6fdf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,14 @@ jobs: services: postgres: image: postgres:10.1 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: pythonorg ports: - - 5432:5432 + - 5432:5432 + # needed because the postgres container does not provide a healthcheck + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - name: Check out repository uses: actions/checkout@v2 @@ -33,7 +39,7 @@ jobs: run: | python -Wd -m coverage run manage.py test -v2 env: - DATABASE_URL: postgres://postgres:@127.0.0.1:5432/python.org + DATABASE_URL: postgres://postgres:postgres@localhost:5432/pythonorg - name: Coverage run: | coverage report -m --fail-under=75 diff --git a/.gitignore b/.gitignore index b2836fa19..8f018dc4f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,9 @@ static/stylesheets/no-mq.css static/stylesheets/style.css __pycache__ *.db +*.py[co] .vscode .~lock.* +.idea +.coverage +.env diff --git a/banners/__init__.py b/banners/__init__.py index e69de29bb..010b54570 100644 --- a/banners/__init__.py +++ b/banners/__init__.py @@ -0,0 +1 @@ +default_app_config = 'banners.apps.BannersAppConfig' diff --git a/banners/apps.py b/banners/apps.py new file mode 100644 index 000000000..9e3aa2c34 --- /dev/null +++ b/banners/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class BannersAppConfig(AppConfig): + + name = 'banners' diff --git a/base-requirements.txt b/base-requirements.txt index 9f92092c4..66b693491 100644 --- a/base-requirements.txt +++ b/base-requirements.txt @@ -1,48 +1,49 @@ dj-database-url==0.5.0 -django-pipeline==1.6.14 -django-sitetree==1.10.0 -Django==2.0.13 +django-pipeline==2.0.6 +django-sitetree==1.17.0 +Django==2.2.24 docutils==0.12 Markdown==3.3.4 -cmarkgfm==0.4.2 +cmarkgfm==0.6.0 Pillow==8.3.1 psycopg2==2.8.6 -python3-openid==3.1.0 +python3-openid==3.2.0 +python-decouple==3.4 # lxml used by BeautifulSoup. lxml==4.6.3 -cssselect==0.9.1 +cssselect==1.1.0 feedparser==6.0.8 -beautifulsoup4==4.6.0 -icalendar==3.8.4 +beautifulsoup4==4.9.3 +icalendar==4.0.7 chardet==4.0.0 # TODO: We may drop 'django-imagekit' completely. django-imagekit==4.0.2 -git+https://github.com/django-haystack/django-haystack.git@802b0f6f4b3b99314453261876a32bac2bbec94f +django-haystack==3.0 elasticsearch>=5,<6 # TODO: 0.14.0 only supports Django 1.8 and 1.11. -django-tastypie==0.14.1 +django-tastypie==0.14.3 -pytz==2017.2 -python-dateutil==2.8.1 +pytz==2021.1 +python-dateutil==2.8.2 requests[security]>=2.26.0 -django-honeypot==0.6.0 -django-markupfield==1.4.3 +django-honeypot==1.0.1 +django-markupfield==2.0.0 django-markupfield-helpers==0.1.1 django-allauth==0.41.0 -django-waffle==0.14 +django-waffle==2.2.1 -djangorestframework==3.8.2 -django-filter==1.1.0 +djangorestframework==3.12.2 +django-filter==2.4.0 django-ordered-model==3.4.3 django-widget-tweaks==1.4.8 -django-countries==6.1.3 +django-countries==7.2.1 xhtml2pdf==0.2.5 -django-easy-pdf==0.1.1 +django-easy-pdf3==0.1.2 num2words==0.5.10 -django-polymorphic==2.1.2 +django-polymorphic==3.0.0 sorl-thumbnail==12.7.0 docxtpl==0.12.0 diff --git a/blogs/__init__.py b/blogs/__init__.py index e69de29bb..620291c46 100644 --- a/blogs/__init__.py +++ b/blogs/__init__.py @@ -0,0 +1 @@ +default_app_config = 'blogs.apps.BlogsAppConfig' diff --git a/blogs/apps.py b/blogs/apps.py new file mode 100644 index 000000000..0c88608d1 --- /dev/null +++ b/blogs/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class BlogsAppConfig(AppConfig): + + name = 'blogs' diff --git a/blogs/urls.py b/blogs/urls.py index 84fe9d9a7..d315ed486 100644 --- a/blogs/urls.py +++ b/blogs/urls.py @@ -1,7 +1,6 @@ -from django.conf.urls import url - from . import views +from django.urls import path urlpatterns = [ - url(r'^$', views.BlogHome.as_view(), name='blog'), + path('', views.BlogHome.as_view(), name='blog'), ] diff --git a/boxes/__init__.py b/boxes/__init__.py index e69de29bb..401a83d2e 100644 --- a/boxes/__init__.py +++ b/boxes/__init__.py @@ -0,0 +1 @@ +default_app_config = 'boxes.apps.BoxesAppConfig' diff --git a/boxes/apps.py b/boxes/apps.py new file mode 100644 index 000000000..6f7e158e2 --- /dev/null +++ b/boxes/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class BoxesAppConfig(AppConfig): + + name = 'boxes' diff --git a/boxes/factories.py b/boxes/factories.py index dde6bf033..5d8c7f2ad 100644 --- a/boxes/factories.py +++ b/boxes/factories.py @@ -4,13 +4,14 @@ import factory from django.conf import settings +from factory.django import DjangoModelFactory from .models import Box from users.factories import UserFactory -class BoxFactory(factory.DjangoModelFactory): +class BoxFactory(DjangoModelFactory): class Meta: model = Box diff --git a/boxes/urls.py b/boxes/urls.py index 2d1e6553d..8ac457c08 100644 --- a/boxes/urls.py +++ b/boxes/urls.py @@ -1,7 +1,6 @@ -from django.conf.urls import url - from .views import box +from django.urls import path urlpatterns = [ - url(r'(?P