Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
- id: ruff
- id: ruff-check
args: [--fix]
- id: ruff-format

Expand Down
1 change: 1 addition & 0 deletions apps/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""pythondotorg Django applications package."""
File renamed without changes.
2 changes: 1 addition & 1 deletion banners/admin.py → apps/banners/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.contrib import admin

from banners.models import Banner
from apps.banners.models import Banner


@admin.register(Banner)
Expand Down
3 changes: 2 additions & 1 deletion banners/apps.py → apps/banners/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
class BannersAppConfig(AppConfig):
"""App configuration for the banners app."""

name = "banners"
name = "apps.banners"
label = "banners"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django import template
from django.template.loader import render_to_string

from banners.models import Banner
from apps.banners.models import Banner

register = template.Library()

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion blogs/admin.py → apps/blogs/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.contrib import admin
from django.core.management import call_command

from blogs.models import BlogEntry, Feed, FeedAggregate
from apps.blogs.models import BlogEntry, Feed, FeedAggregate


@admin.register(BlogEntry)
Expand Down
3 changes: 2 additions & 1 deletion blogs/apps.py → apps/blogs/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
class BlogsAppConfig(AppConfig):
"""App configuration for the blogs app."""

name = "blogs"
name = "apps.blogs"
label = "blogs"
2 changes: 1 addition & 1 deletion blogs/factories.py → apps/blogs/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.conf import settings

from blogs.models import Feed
from apps.blogs.models import Feed


def initial_data():
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.core.management.base import BaseCommand
from django.utils.timezone import now

from blogs.models import BlogEntry, Feed, RelatedBlog
from blogs.parser import get_all_entries, update_blog_supernav
from apps.blogs.models import BlogEntry, Feed, RelatedBlog
from apps.blogs.parser import get_all_entries, update_blog_supernav


class Command(BaseCommand):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion blogs/models.py → apps/blogs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from bs4.element import Comment
from django.db import models

from cms.models import ContentManageable
from apps.cms.models import ContentManageable


def tag_visible(element):
Expand Down
4 changes: 2 additions & 2 deletions blogs/parser.py → apps/blogs/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from django.conf import settings
from django.template.loader import render_to_string

from blogs.models import BlogEntry, Feed
from boxes.models import Box
from apps.blogs.models import BlogEntry, Feed
from apps.boxes.models import Box


def get_all_entries(feed_url):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django import template

from blogs.models import BlogEntry
from apps.blogs.models import BlogEntry

register = template.Library()

Expand Down
File renamed without changes.
1,724 changes: 862 additions & 862 deletions blogs/tests/psf_feed_example.xml → apps/blogs/tests/psf_feed_example.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.test import TestCase
from django.utils import timezone

from blogs.models import BlogEntry, Feed
from apps.blogs.models import BlogEntry, Feed


class BlogModelTest(TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import datetime
import unittest

from blogs.parser import get_all_entries
from blogs.tests.utils import get_test_rss_path
from apps.blogs.parser import get_all_entries
from apps.blogs.tests.utils import get_test_rss_path


class BlogParserTest(unittest.TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from django.test import TestCase
from django.utils.timezone import now

from blogs.models import BlogEntry, Feed, FeedAggregate
from blogs.templatetags.blogs import get_latest_blog_entries
from blogs.tests.utils import get_test_rss_path
from apps.blogs.models import BlogEntry, Feed, FeedAggregate
from apps.blogs.templatetags.blogs import get_latest_blog_entries
from apps.blogs.tests.utils import get_test_rss_path


class BlogTemplateTagTest(TestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from django.test import TestCase
from django.urls import reverse

from blogs.models import BlogEntry, Feed
from blogs.tests.utils import get_test_rss_path
from apps.blogs.models import BlogEntry, Feed
from apps.blogs.tests.utils import get_test_rss_path


class BlogViewTest(TestCase):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion blogs/urls.py → apps/blogs/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.urls import path

from blogs import views
from apps.blogs import views

urlpatterns = [
path("", views.BlogHome.as_view(), name="blog"),
Expand Down
2 changes: 1 addition & 1 deletion blogs/views.py → apps/blogs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.views.generic import TemplateView

from blogs.models import BlogEntry
from apps.blogs.models import BlogEntry


class BlogHome(TemplateView):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions boxes/admin.py → apps/boxes/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from django.contrib import admin

from boxes.models import Box
from cms.admin import ContentManageableModelAdmin
from apps.boxes.models import Box
from apps.cms.admin import ContentManageableModelAdmin


@admin.register(Box)
Expand Down
3 changes: 2 additions & 1 deletion boxes/apps.py → apps/boxes/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
class BoxesAppConfig(AppConfig):
"""App configuration for the boxes app."""

name = "boxes"
name = "apps.boxes"
label = "boxes"
4 changes: 2 additions & 2 deletions boxes/factories.py → apps/boxes/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from django.conf import settings
from factory.django import DjangoModelFactory

from boxes.models import Box
from users.factories import UserFactory
from apps.boxes.models import Box
from apps.users.factories import UserFactory


class BoxFactory(DjangoModelFactory):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion boxes/models.py → apps/boxes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from django.db import models
from markupfield.fields import MarkupField

from cms.models import ContentManageable
from apps.cms.models import ContentManageable

DEFAULT_MARKUP_TYPE = getattr(settings, "DEFAULT_MARKUP_TYPE", "restructuredtext")

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django import template
from django.utils.html import mark_safe

from boxes.models import Box
from apps.boxes.models import Box

log = logging.getLogger(__name__)
register = template.Library()
Expand Down
4 changes: 2 additions & 2 deletions boxes/tests.py → apps/boxes/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django import template
from django.test import TestCase, override_settings

from boxes.models import Box
from apps.boxes.models import Box

logging.disable(logging.CRITICAL)

Expand All @@ -28,7 +28,7 @@ def test_tag_invalid_label(self):


class ViewTests(BaseTestCase):
@override_settings(ROOT_URLCONF="boxes.urls")
@override_settings(ROOT_URLCONF="apps.boxes.urls")
def test_box_view(self):
r = self.client.get("/test/")
self.assertContains(r, self.box.content.rendered)
2 changes: 1 addition & 1 deletion boxes/urls.py → apps/boxes/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.urls import path

from boxes.views import box
from apps.boxes.views import box

urlpatterns = [
path("<slug:label>/", box, name="box"),
Expand Down
2 changes: 1 addition & 1 deletion boxes/views.py → apps/boxes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.http import HttpResponse
from django.shortcuts import get_object_or_404

from boxes.models import Box
from apps.boxes.models import Box


def box(request, label):
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion cms/apps.py → apps/cms/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
class CmsAppConfig(AppConfig):
"""App configuration for the cms app."""

name = "cms"
name = "apps.cms"
label = "cms"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions cms/tests.py → apps/cms/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from django.template import Context, Template
from django.test import TestCase

from cms.admin import ContentManageableModelAdmin
from cms.views import legacy_path
from apps.cms.admin import ContentManageableModelAdmin
from apps.cms.views import legacy_path


class ContentManageableAdminTests(unittest.TestCase):
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions codesamples/admin.py → apps/codesamples/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.contrib import admin

from cms.admin import ContentManageableModelAdmin
from codesamples.models import CodeSample
from apps.cms.admin import ContentManageableModelAdmin
from apps.codesamples.models import CodeSample

admin.site.register(CodeSample, ContentManageableModelAdmin)
3 changes: 2 additions & 1 deletion codesamples/apps.py → apps/codesamples/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
class CodesamplesAppConfig(AppConfig):
"""App configuration for the codesamples app."""

name = "codesamples"
name = "apps.codesamples"
label = "codesamples"
4 changes: 2 additions & 2 deletions codesamples/factories.py → apps/codesamples/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import factory
from factory.django import DjangoModelFactory

from codesamples.models import CodeSample
from users.factories import UserFactory
from apps.codesamples.models import CodeSample
from apps.users.factories import UserFactory


class CodeSampleFactory(DjangoModelFactory):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions codesamples/models.py → apps/codesamples/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from django.template.defaultfilters import striptags, truncatechars
from markupfield.fields import MarkupField

from cms.models import ContentManageable
from codesamples.managers import CodeSampleQuerySet
from apps.cms.models import ContentManageable
from apps.codesamples.managers import CodeSampleQuerySet

DEFAULT_MARKUP_TYPE = getattr(settings, "DEFAULT_MARKUP_TYPE", "html")

Expand Down
2 changes: 1 addition & 1 deletion codesamples/tests.py → apps/codesamples/tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.test import TestCase

from codesamples.models import CodeSample
from apps.codesamples.models import CodeSample


class CodeSampleModelTests(TestCase):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions community/admin.py → apps/community/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from django.contrib import admin

from cms.admin import ContentManageableModelAdmin, ContentManageableStackedInline
from community.models import Link, Photo, Post, Video
from apps.cms.admin import ContentManageableModelAdmin, ContentManageableStackedInline
from apps.community.models import Link, Photo, Post, Video


class LinkInline(ContentManageableStackedInline):
Expand Down
3 changes: 2 additions & 1 deletion community/apps.py → apps/community/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
class CommunityAppConfig(AppConfig):
"""App configuration for the community app."""

name = "community"
name = "apps.community"
label = "community"
File renamed without changes.
4 changes: 2 additions & 2 deletions community/models.py → apps/community/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from django.utils.translation import gettext_lazy as _
from markupfield.fields import MarkupField

from cms.models import ContentManageable
from community.managers import PostQuerySet
from apps.cms.models import ContentManageable
from apps.community.managers import PostQuerySet

DEFAULT_MARKUP_TYPE = "html"

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.test import TestCase

from community.models import Post
from apps.community.models import Post


class CommunityManagersTest(TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.test import TestCase

from community.models import Post
from apps.community.models import Post


class ModelTestCase(TestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from community.models import Post
from apps.community.models import Post
from pydotorg.tests.test_classes import TemplateTestCase


Expand Down
2 changes: 1 addition & 1 deletion community/urls.py → apps/community/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.urls import path

from community import views
from apps.community import views

app_name = "community"
urlpatterns = [
Expand Down
2 changes: 1 addition & 1 deletion community/views.py → apps/community/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.views.generic import DetailView, ListView

from community.models import Post
from apps.community.models import Post


class PostList(ListView):
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions companies/admin.py → apps/companies/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from django.contrib import admin

from cms.admin import NameSlugAdmin
from companies.models import Company
from apps.cms.admin import NameSlugAdmin
from apps.companies.models import Company


@admin.register(Company)
Expand Down
3 changes: 2 additions & 1 deletion companies/apps.py → apps/companies/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
class CompaniesAppConfig(AppConfig):
"""App configuration for the companies app."""

name = "companies"
name = "apps.companies"
label = "companies"
Loading