aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2023-03-29 20:56:48 +0200
committerGravatar GitHub <[email protected]>2023-03-29 20:56:48 +0200
commitd4ba9cea9aed3b6ec276075cd4db584a3f219def (patch)
treef2371b7174082baac0b8d07abe1b295abc2fca51
parentMerge pull request #920 from python-discord/dependabot/pip/django-filter-23.1 (diff)
parentAdd a readme for the home app (diff)
Merge pull request #922 from python-discord/add-home-app-readmeadd-home-app-readme
Add a readme for the home app
-rw-r--r--.coveragerc2
-rw-r--r--pydis_site/apps/home/README.md35
-rw-r--r--pydis_site/apps/home/models.py (renamed from pydis_site/apps/home/models/repository_metadata.py)0
-rw-r--r--pydis_site/apps/home/models/__init__.py3
-rw-r--r--pydis_site/apps/home/views.py (renamed from pydis_site/apps/home/views/home.py)0
-rw-r--r--pydis_site/apps/home/views/__init__.py3
6 files changed, 36 insertions, 7 deletions
diff --git a/.coveragerc b/.coveragerc
index 039654db..38926b22 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -14,7 +14,7 @@ omit =
pydis_site/wsgi.py
pydis_site/settings.py
pydis_site/utils/resources.py
- pydis_site/apps/home/views/home.py
+ pydis_site/apps/home/views.py
[report]
fail_under = 100
diff --git a/pydis_site/apps/home/README.md b/pydis_site/apps/home/README.md
new file mode 100644
index 00000000..34c1e367
--- /dev/null
+++ b/pydis_site/apps/home/README.md
@@ -0,0 +1,35 @@
+# The "home" app
+
+This Django application takes care of serving the homepage of our website, that
+is, the first page that you see when you open pythondiscord.com. It also
+manages the timeline page showcasing the history of our community.
+
+## Directory structure
+
+- `migrations` is the standard Django migrations folder. As with [the API
+ app](../api/README.md), you usually won't need to edit this manually, use
+ `python manage.py makemigrations [-n short_description]` to create a new
+ migration here.
+
+- `templatetags` contains custom [template tags and
+ filters](https://docs.djangoproject.com/en/dev/howto/custom-template-tags/)
+ used in the home app.
+
+- `tests` contains unit tests that validate the home app works as expected. If
+ you're looking for guidance in writing tests, the [Django tutorial
+ introducing automated
+ testing](https://docs.djangoproject.com/en/dev/intro/tutorial05/) is a great
+ starting point.
+
+As for the Python modules residing directly in here:
+
+- `models.py` contains our Django model definitions for this app. As this app
+ is rather minimal, this is kept as a single module - more models would be
+ split up into a subfolder as in the other apps.
+
+- `urls.py` configures Django's [URL
+ dispatcher](https://docs.djangoproject.com/en/dev/topics/http/urls/) for our
+ home endpoints.
+
+- `views.py` contains our Django views. You can see where they are linked in the
+ URL dispatcher.
diff --git a/pydis_site/apps/home/models/repository_metadata.py b/pydis_site/apps/home/models.py
index 00a83cd7..00a83cd7 100644
--- a/pydis_site/apps/home/models/repository_metadata.py
+++ b/pydis_site/apps/home/models.py
diff --git a/pydis_site/apps/home/models/__init__.py b/pydis_site/apps/home/models/__init__.py
deleted file mode 100644
index 6c68df9c..00000000
--- a/pydis_site/apps/home/models/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from .repository_metadata import RepositoryMetadata
-
-__all__ = ["RepositoryMetadata"]
diff --git a/pydis_site/apps/home/views/home.py b/pydis_site/apps/home/views.py
index 8a165682..8a165682 100644
--- a/pydis_site/apps/home/views/home.py
+++ b/pydis_site/apps/home/views.py
diff --git a/pydis_site/apps/home/views/__init__.py b/pydis_site/apps/home/views/__init__.py
deleted file mode 100644
index 28cc4d65..00000000
--- a/pydis_site/apps/home/views/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from .home import HomeView, timeline
-
-__all__ = ["HomeView", "timeline"]