From aa00efc6048c4bca46acabe18ee6d1b08f52e0e5 Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Mon, 30 Aug 2021 22:53:52 +0200 Subject: Allow empty value for inventory url field --- .../api/migrations/0072_doc_allow_blank_base_url.py | 19 +++++++++++++++++++ pydis_site/apps/api/models/bot/documentation_link.py | 1 + 2 files changed, 20 insertions(+) create mode 100644 pydis_site/apps/api/migrations/0072_doc_allow_blank_base_url.py (limited to 'pydis_site') diff --git a/pydis_site/apps/api/migrations/0072_doc_allow_blank_base_url.py b/pydis_site/apps/api/migrations/0072_doc_allow_blank_base_url.py new file mode 100644 index 00000000..d4899354 --- /dev/null +++ b/pydis_site/apps/api/migrations/0072_doc_allow_blank_base_url.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.14 on 2021-08-30 21:09 + +from django.db import migrations, models +import pydis_site.apps.api.models.bot.documentation_link + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0071_increase_message_content_4000'), + ] + + operations = [ + migrations.AlterField( + model_name='documentationlink', + name='base_url', + field=models.URLField(blank=True, help_text='The base URL from which documentation will be available for this project. Used to generate links to various symbols within this package.', validators=[pydis_site.apps.api.models.bot.documentation_link.ends_with_slash_validator]), + ), + ] diff --git a/pydis_site/apps/api/models/bot/documentation_link.py b/pydis_site/apps/api/models/bot/documentation_link.py index 3dcc71fc..9941907c 100644 --- a/pydis_site/apps/api/models/bot/documentation_link.py +++ b/pydis_site/apps/api/models/bot/documentation_link.py @@ -30,6 +30,7 @@ class DocumentationLink(ModelReprMixin, models.Model): "The base URL from which documentation will be available for this project. " "Used to generate links to various symbols within this package." ), + blank=True, validators=(ends_with_slash_validator,) ) inventory_url = models.URLField( -- cgit v1.2.3 From 58e061109f3ce09e1d8687f61ad22a335deb893a Mon Sep 17 00:00:00 2001 From: Numerlor <25886452+Numerlor@users.noreply.github.com> Date: Mon, 30 Aug 2021 23:04:40 +0200 Subject: Move base_url field to the end In most cases this won't need to be specified, so it makes more sense to move it out of the way --- pydis_site/apps/api/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/api/admin.py b/pydis_site/apps/api/admin.py index 449e660e..2aca38a1 100644 --- a/pydis_site/apps/api/admin.py +++ b/pydis_site/apps/api/admin.py @@ -48,8 +48,8 @@ class BotSettingAdmin(admin.ModelAdmin): class DocumentationLinkAdmin(admin.ModelAdmin): """Admin formatting for the DocumentationLink model.""" - fields = ("package", "base_url", "inventory_url") - list_display = ("package", "base_url", "inventory_url") + fields = ("package", "inventory_url", "base_url") + list_display = ("package", "inventory_url", "base_url") list_editable = ("base_url", "inventory_url") search_fields = ("package",) -- cgit v1.2.3 From 89d7dacf3337fed0685aad4409e86b3e137246ad Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Thu, 2 Sep 2021 21:15:31 +0000 Subject: Add Django Prometheus to installed apps and middleware --- Dockerfile | 1 + pydis_site/settings.py | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'pydis_site') diff --git a/Dockerfile b/Dockerfile index c07fc2e2..46f45bf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,7 @@ COPY . . # Set dummy variables so collectstatic can load settings.py RUN \ + BUILDING_DOCKER=yes \ SECRET_KEY=dummy_value \ DATABASE_URL=postgres://localhost \ METRICITY_DB_URL=postgres://localhost \ diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 7df7ad85..61f3b6f8 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -23,7 +23,8 @@ from pydis_site.constants import GIT_SHA env = environ.Env( DEBUG=(bool, False), - SITE_DSN=(str, "") + SITE_DSN=(str, ""), + BUILDING_DOCKER=(bool, False) ) sentry_sdk.init( @@ -84,10 +85,15 @@ INSTALLED_APPS = [ 'django_filters', 'django_simple_bulma', 'rest_framework', - 'rest_framework.authtoken' + 'rest_framework.authtoken', ] +if not env("BUILDING_DOCKER"): + INSTALLED_APPS.append("django_prometheus") + +# Ensure that Prometheus middlewares are first and last here. MIDDLEWARE = [ + 'django_prometheus.middleware.PrometheusBeforeMiddleware', 'django_hosts.middleware.HostsRequestMiddleware', 'django.middleware.security.SecurityMiddleware', @@ -100,7 +106,9 @@ MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django_hosts.middleware.HostsResponseMiddleware', + 'django_prometheus.middleware.PrometheusAfterMiddleware' ] + ROOT_URLCONF = 'pydis_site.urls' TEMPLATES = [ @@ -131,7 +139,7 @@ WSGI_APPLICATION = 'pydis_site.wsgi.application' DATABASES = { 'default': env.db(), - 'metricity': env.db('METRICITY_DB_URL'), + 'metricity': env.db(), } # Password validation -- cgit v1.2.3 From b051c454ac853a145fa961f4409fcadd8b1d5dbc Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Thu, 2 Sep 2021 21:15:52 +0000 Subject: Add Django Prometheus to URLs --- pydis_site/apps/home/urls.py | 1 + 1 file changed, 1 insertion(+) (limited to 'pydis_site') diff --git a/pydis_site/apps/home/urls.py b/pydis_site/apps/home/urls.py index 1e2af8f3..bb77220b 100644 --- a/pydis_site/apps/home/urls.py +++ b/pydis_site/apps/home/urls.py @@ -7,6 +7,7 @@ app_name = 'home' urlpatterns = [ path('', HomeView.as_view(), name='home'), path('', include('pydis_site.apps.redirect.urls')), + path('', include('django_prometheus.urls')), path('admin/', admin.site.urls), path('resources/', include('pydis_site.apps.resources.urls')), path('pages/', include('pydis_site.apps.content.urls')), -- cgit v1.2.3 From 4a6ea09f3849f86d8307526e23362ea93365ebef Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Thu, 2 Sep 2021 21:27:54 +0000 Subject: Revert change to Metricity DB URL Co-Authored-By: jchristgit --- pydis_site/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 61f3b6f8..6f49763b 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -139,7 +139,7 @@ WSGI_APPLICATION = 'pydis_site.wsgi.application' DATABASES = { 'default': env.db(), - 'metricity': env.db(), + 'metricity': env.db('METRICITY_DB_URL'), } # Password validation -- cgit v1.2.3 From fa68a1063d4de205cb34c1f17eda62926b23b9db Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Fri, 3 Sep 2021 10:40:16 +0100 Subject: Timeout when fetching GitHub repository metadata Not having this timeout could cause a worker to hang indefinitely --- pydis_site/apps/home/views/home.py | 15 +++++++++++---- pydis_site/constants.py | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/home/views/home.py b/pydis_site/apps/home/views/home.py index 0f26cef3..bbb4b815 100644 --- a/pydis_site/apps/home/views/home.py +++ b/pydis_site/apps/home/views/home.py @@ -9,7 +9,7 @@ from django.utils import timezone from django.views import View from pydis_site.apps.home.models import RepositoryMetadata -from pydis_site.constants import GITHUB_TOKEN +from pydis_site.constants import GITHUB_TOKEN, TIMEOUT_PERIOD log = logging.getLogger(__name__) @@ -51,9 +51,16 @@ class HomeView(View): If we're unable to get that info for any reason, return an empty dict. """ repo_dict = {} - - # Fetch the data from the GitHub API - api_data: List[dict] = requests.get(self.github_api, headers=self.headers).json() + try: + # Fetch the data from the GitHub API + api_data: List[dict] = requests.get( + self.github_api, + headers=self.headers, + timeout=TIMEOUT_PERIOD + ).json() + except requests.exceptions.Timeout: + log.error("Request to fetch GitHub repository metadata for timed out!") + return repo_dict # Process the API data into our dict for repo in api_data: diff --git a/pydis_site/constants.py b/pydis_site/constants.py index e6a63d12..e913f40f 100644 --- a/pydis_site/constants.py +++ b/pydis_site/constants.py @@ -2,3 +2,5 @@ import os GIT_SHA = os.environ.get("GIT_SHA", "development") GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN") +# How long to wait for synchronous requests before timing out +TIMEOUT_PERIOD = int(os.environ.get("TIMEOUT_PERIOD", 5)) -- cgit v1.2.3 From 8a4b1a15262a91d486c4b95e19533d4d44dd7c2b Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 4 Sep 2021 10:32:10 +0100 Subject: Add pod IPs to allowed hosts --- pydis_site/settings.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 6f49763b..0aa66322 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -14,6 +14,7 @@ import os import secrets import sys from pathlib import Path +from socket import gethostname, gethostbyname import environ import sentry_sdk @@ -59,6 +60,8 @@ else: 'api.pythondiscord.com', 'staff.pythondiscord.com', 'pydis-api.default.svc.cluster.local', + gethostname(), + gethostbyname(gethostname()) ] ) SECRET_KEY = env('SECRET_KEY') -- cgit v1.2.3 From cc6fed3b13ba1aa9ec3cf84227048c9d04ebecda Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 4 Sep 2021 10:34:52 +0100 Subject: Correct import order --- pydis_site/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 0aa66322..d2cd8698 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -14,7 +14,7 @@ import os import secrets import sys from pathlib import Path -from socket import gethostname, gethostbyname +from socket import gethostbyname, gethostname import environ import sentry_sdk -- cgit v1.2.3 From 6730607d389e53276d3791a423f92f3a3f1349ef Mon Sep 17 00:00:00 2001 From: mbaruh Date: Tue, 7 Sep 2021 23:20:10 +0300 Subject: Update embed description length to 4096 --- pydis_site/apps/api/models/utils.py | 2 +- pydis_site/apps/api/tests/test_validators.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/api/models/utils.py b/pydis_site/apps/api/models/utils.py index 107231ba..0e220a1d 100644 --- a/pydis_site/apps/api/models/utils.py +++ b/pydis_site/apps/api/models/utils.py @@ -142,7 +142,7 @@ def validate_embed(embed: Any) -> None: ), MaxLengthValidator(limit_value=256) ), - 'description': (MaxLengthValidator(limit_value=2048),), + 'description': (MaxLengthValidator(limit_value=4096),), 'fields': ( MaxLengthValidator(limit_value=25), validate_embed_fields diff --git a/pydis_site/apps/api/tests/test_validators.py b/pydis_site/apps/api/tests/test_validators.py index 8bb7b917..551cc2aa 100644 --- a/pydis_site/apps/api/tests/test_validators.py +++ b/pydis_site/apps/api/tests/test_validators.py @@ -72,7 +72,7 @@ class TagEmbedValidatorTests(TestCase): def test_rejects_too_long_description(self): with self.assertRaises(ValidationError): validate_embed({ - 'description': 'd' * 2049 + 'description': 'd' * 4097 }) def test_allows_valid_embed(self): -- cgit v1.2.3 From 198406da7d45b672bc4213d407f2a4c79acddaa8 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 10 Sep 2021 23:23:31 +0100 Subject: Update repository selection on home page In accordance with a poll in #dev-contrib, King Arthur becomes the 6th repository featured on the Python Discord homepage. --- pydis_site/apps/home/views/home.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/home/views/home.py b/pydis_site/apps/home/views/home.py index bbb4b815..401c768f 100644 --- a/pydis_site/apps/home/views/home.py +++ b/pydis_site/apps/home/views/home.py @@ -27,7 +27,7 @@ class HomeView(View): "python-discord/snekbox", "python-discord/sir-lancebot", "python-discord/metricity", - "python-discord/django-simple-bulma", + "python-discord/king-arthur", ] def __init__(self): -- cgit v1.2.3 From 98eb08ccb82e14326828e00e76b022bdb0c23f1e Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 10 Sep 2021 23:43:56 +0100 Subject: Update mock GitHub API response Fixes breaking tests --- pydis_site/apps/home/tests/mock_github_api_response.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/apps/home/tests/mock_github_api_response.json b/pydis_site/apps/home/tests/mock_github_api_response.json index ddbffed8..3b0a7078 100644 --- a/pydis_site/apps/home/tests/mock_github_api_response.json +++ b/pydis_site/apps/home/tests/mock_github_api_response.json @@ -21,7 +21,7 @@ "forks_count": 31 }, { - "full_name": "python-discord/django-simple-bulma", + "full_name": "python-discord/king-arthur", "description": "test", "stargazers_count": 97, "language": "Python", -- cgit v1.2.3 From 2bf473ea1c22ea28de9cbc7a842c465a2f931b3c Mon Sep 17 00:00:00 2001 From: Janine vN Date: Sat, 18 Sep 2021 18:16:35 -0400 Subject: Remove code jam notice from front page --- pydis_site/templates/home/index.html | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/home/index.html b/pydis_site/templates/home/index.html index 072e3817..8e52274d 100644 --- a/pydis_site/templates/home/index.html +++ b/pydis_site/templates/home/index.html @@ -9,21 +9,14 @@ {% block content %} {% include "base/navbar.html" %} - -
- - Summer Code Jam 2021 - -
-
-
+
{# Embedded Welcome video #} -
+
- - {# Code Jam banner #} -
- - Summer Code Jam 2021 - -
-- cgit v1.2.3 From a7afdf4f8742a3f3f61883e92604d0fe08c8f199 Mon Sep 17 00:00:00 2001 From: Janine vN Date: Sat, 18 Sep 2021 18:26:32 -0400 Subject: Update wording on main Events page --- pydis_site/templates/events/index.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/events/index.html b/pydis_site/templates/events/index.html index daad1c9c..352a3aa9 100644 --- a/pydis_site/templates/events/index.html +++ b/pydis_site/templates/events/index.html @@ -9,11 +9,8 @@ {% block event_content %}

Code Jams

-
- The 2021 Summer Code Jam qualifier will open June 21st. Check out the details here. -
-

Each year, we organize a Winter Code Jam and a Summer Code Jam. During these events, members of our community will work together in teams to create something amazing using a technology we picked for them. One such technology that was picked for the Winter Code Jam 2020 was Kivy, a cross-platform GUI framework.

-

To help fuel the creative process, we provide a specific theme, like Ancient Technology or This App Hates You. At the end of the Code Jam, the projects are judged by Python Discord server staff members and guest judges from the larger Python community. The judges will consider creativity, code quality, teamwork, and adherence to the theme.

+

Each year, we organize at least one code jam, one during the summer and sometimes one during the winter. During these events, members of our community will work together in teams to create something amazing using a technology we picked for them. One such technology that was picked for the Summer 2021 Code Jam was text user interfaces (TUIS), where teams could pick from a pre-approved list of frameworks.

+

To help fuel the creative process, we provide a specific theme, like Think Outside the Box or Early Internet. At the end of the Code Jam, the projects are judged by Python Discord server staff members and guest judges from the larger Python community. The judges will consider creativity, code quality, teamwork, and adherence to the theme.

If you want to read more about Code Jams, visit our Code Jam info page or watch this video showcasing the best projects created during the Winter Code Jam 2020: Ancient Technology:

@@ -121,6 +118,5 @@ {% endblock %} {% block sidebar %} - {% include "events/sidebar/ongoing-event.html" %} {% include "events/sidebar/events-list.html" %} {% endblock %} -- cgit v1.2.3 From d7d0f2de54720c257d066fce1bcfc5c66dde2d89 Mon Sep 17 00:00:00 2001 From: Janine vN Date: Sat, 18 Sep 2021 18:34:51 -0400 Subject: Update events featured Re-ordered and updated the events listed on the main events page. We're no longer participating in Hacktoberfest, so that was removed. Game jams was moved to the bottom as we have not hosted one and will not for the forseeable future. PyWeek was moved above Advent of Code because AoC is one of the last events we do in the year so it didn't make sense to have PyWeek below it. This also updated the Events Calendar on the sidebar to be accurate for 2021. --- pydis_site/templates/events/index.html | 64 +++++++--------------- .../templates/events/sidebar/events-list.html | 10 ++-- 2 files changed, 26 insertions(+), 48 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/events/index.html b/pydis_site/templates/events/index.html index 352a3aa9..b5c556e5 100644 --- a/pydis_site/templates/events/index.html +++ b/pydis_site/templates/events/index.html @@ -16,48 +16,27 @@
-

Game Jam

+

PyWeek

- The Game Jam is similar to our Code Jams, but smaller in scope. Instead of having to complete a qualifier - and being teamed up with random strangers, members of our community can just sign-up individually or pair up - with whoever they like. -

-

- The participants will have ten days to create a game using the technology we've selected, and drawing - inspiration from a provided theme. After the event, a panel of judges will play all the games and select a - winner. The top 5 will featured in a special video on our YouTube channel. -

-

- The first edition of the Game Jam ran from - April 17, 2020 to April 26, 2020. + For the past 15 years, PyWeek has been running a bi-annual game jam for the + Python language. As of 2020, we are excited to say we are officially partnered with PyWeek to co-run these + events.

-
-
- -
-
-
- -
-

Hacktoberfest

-
-

- This event revolves around the annual Hacktoberfest - event organized by Digital Ocean. In addition to promoting Hacktoberfest in our community and supporting - those who choose to take their first steps into the world of open source, we will also ease our members into - contributing to open source by starting a low-entry, beginner-friendly open source project where we will - guide our members through the open source process in a safe environment. + During each PyWeek event, we open a special discussion channel in which our members can discuss their + submissions, meet other participants, and talk to PyWeek staff. The PyWeek organizer, + Daniel Pope (@lordmauve) will be present during the entire event to answer + questions and post announcements and information in our community.

- The exact form this event will take has not been decided yet, but we'll make sure to keep you updated in - our community announcements! + Unlike our other events, the community will select the winner from all the submissions + during PyWeek. We may release YouTube content showcasing the best submissions after the events are finished.

- +
@@ -91,27 +70,26 @@
-

PyWeek

+

Game Jam

- For the past 15 years, PyWeek has been running a bi-annual game jam for the - Python language. As of 2020, we are excited to say we are officially partnered with PyWeek to co-run these - events. + The Game Jam is similar to our Code Jams, but smaller in scope. Instead of having to complete a qualifier + and being teamed up with random strangers, members of our community can just sign-up individually or pair up + with whoever they like.

- During each PyWeek event, we open a special discussion channel in which our members can discuss their - submissions, meet other participants, and talk to PyWeek staff. The PyWeek organizer, - Daniel Pope (@lordmauve) will be present during the entire event to answer - questions and post announcements and information in our community. + The participants will have ten days to create a game using the technology we've selected, and drawing + inspiration from a provided theme. After the event, a panel of judges will play all the games and select a + winner. The top 5 will featured in a special video on our YouTube channel.

- Unlike our other events, the community will select the winner from all the submissions - during PyWeek. We may release YouTube content showcasing the best submissions after the events are finished. + The first edition of the Game Jam ran from + April 17, 2020 to April 26, 2020.

- +
diff --git a/pydis_site/templates/events/sidebar/events-list.html b/pydis_site/templates/events/sidebar/events-list.html index 327b0e77..6029ae74 100644 --- a/pydis_site/templates/events/sidebar/events-list.html +++ b/pydis_site/templates/events/sidebar/events-list.html @@ -1,10 +1,10 @@ -- cgit v1.2.3 From c4731bfe1ed27ee8047fa9226158e927ec8600f7 Mon Sep 17 00:00:00 2001 From: Janine vN Date: Sat, 18 Sep 2021 19:13:20 -0400 Subject: Update Code Jam 8 as a finished event This commit adds in the information about the winners of the code jam. Additionally, it adds in Code Jam 8 as a prior event in the sidebar. --- .../templates/events/pages/code-jams/8/_index.html | 52 +++++++++++++++++++--- .../sidebar/code-jams/previous-code-jams.html | 1 + 2 files changed, 47 insertions(+), 6 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/events/pages/code-jams/8/_index.html b/pydis_site/templates/events/pages/code-jams/8/_index.html index 55bdc95b..c789adef 100644 --- a/pydis_site/templates/events/pages/code-jams/8/_index.html +++ b/pydis_site/templates/events/pages/code-jams/8/_index.html @@ -20,6 +20,50 @@ and walking through the program that your team has created.

+

Code Jam Winners

+

Congratulations to our winners and the two runner ups! Check out their projects below.

+

Perceptive Porcupines: WTPython!?

+

VV, Poppinawhile, ethansocal, Jeff Z, Cohan, ¯\_(ツ)_/¯

+

+ What the Python (wtpython) is a simple terminal user interface that allows you to explore relevant answers on Stackoverflow without leaving your terminal or IDE. When you get an error, all you have to do is swap python for wtpython. When your code hits an error, you'll see a textual interface for exploring relevant answers allowing you to stay focused and ship faster! +
+ Demo video +
+ Githib Repository +
+ +

+ +

Lovable Lobsters: Ultimate Tic Tac Toe

+

A5Rocks, Bast, Dacheat, mega_hirtz, CopOnTheRun, richphi

+

+ Thinking inside a box, that is inside a box, that is inside yet another box. + + The terminal program created by the Lovable Lobsters allows you to play Ultimate Tic Tac Toe right form your terminal. The really impressive part though? You can play with your friends and family over your network! Their program has a server-client set-up that lets you play with your friends and family from different computers. +
+ Demo video +
+ Githib Repository +
+

+ +

Robust Reindeer: Rubick's Cube

+

Björn, aaronshenhao, mathsman, Dude Saber, 詭異, Keppo

+

+ This submission is a Rubik's cube, rendered in a text user interface (that was a constraint) using the asciimatics package, and addressing the theme "thinking inside the box". + + Just like a real world Rubik's cube, you can move this cube around to look at it from all sides. And, of course, you can rotate the individual discs it is made up of to first scramble up the order and then to try and solve it into perfect ordering again. +
+ Githib Repository +
+

+ +

Submissions

+

+ 63 teams started out on July 9th 2021. By the end of the jam, 51 teams made project submissions. Check them all out here: +

+

+

Important Dates

  • Tuesday, June 15 - Form to submit theme suggestions opens
  • @@ -43,7 +87,7 @@ The qualifier is a coding challenge that you are required to complete before registering for the code jam. This is meant as a basic assessment of your skills to ensure you have enough python knowledge to effectively contribute in a team environment.

    -

    View the Qualifier

    View the Qualifier

    Please note the requirements for the qualifier.

      @@ -52,11 +96,7 @@
    • The Qualifier must be submitted through the Code Jam sign-up form.

    -

    Submissions

    -

    - 63 teams started out on July 9th 2021. By the end of the jam, 51 teams made project submissions. Check them all out here: -

    -

    +

    Prizes

    Our Code Jam Sponsors have provided prizes for the winners of the code jam. diff --git a/pydis_site/templates/events/sidebar/code-jams/previous-code-jams.html b/pydis_site/templates/events/sidebar/code-jams/previous-code-jams.html index 9f9ecd1a..393eec6f 100644 --- a/pydis_site/templates/events/sidebar/code-jams/previous-code-jams.html +++ b/pydis_site/templates/events/sidebar/code-jams/previous-code-jams.html @@ -1,6 +1,7 @@

    - +
    diff --git a/pydis_site/templates/events/sidebar/code-jams/previous-code-jams.html b/pydis_site/templates/events/sidebar/code-jams/previous-code-jams.html index 393eec6f..21b2ccb4 100644 --- a/pydis_site/templates/events/sidebar/code-jams/previous-code-jams.html +++ b/pydis_site/templates/events/sidebar/code-jams/previous-code-jams.html @@ -1,7 +1,7 @@
    Microsoft's Python Development Team also runs a Discord Server for discussions of Python in the Microsoft ecosystem, including Visual Studio Code and Azure. -title_image: http://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE2qVsJ?ver=3f74 +title_image: https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE2qVsJ?ver=3f74 position: 4 urls: - icon: branding/youtube diff --git a/pydis_site/settings.py b/pydis_site/settings.py index d2cd8698..8d092ac9 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -201,7 +201,7 @@ else: PARENT_HOST = env('PARENT_HOST', default='pythondiscord.com') # Django REST framework -# http://www.django-rest-framework.org +# https://www.django-rest-framework.org REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.TokenAuthentication', diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html index d7cb49b2..ed04995c 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -44,7 +44,7 @@ {# Patreon #} - +  Patreon diff --git a/pydis_site/templates/events/pages/code-jams/8/frameworks.html b/pydis_site/templates/events/pages/code-jams/8/frameworks.html index 34ac4f0a..1c02e38a 100644 --- a/pydis_site/templates/events/pages/code-jams/8/frameworks.html +++ b/pydis_site/templates/events/pages/code-jams/8/frameworks.html @@ -19,7 +19,7 @@
      -
    • Documentation Link
    • +
    • Documentation Link
    • Supports: Linux, Mac, other unix-like OS
    • Somewhat in-depth tutorial
    • Uses widgets in a fairly straight forward design
    • -- cgit v1.2.3 From b8466fcbb3325b590c4b6ebe508ee35d02dc4b6a Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Wed, 6 Oct 2021 02:17:14 +0400 Subject: Properly Resize Sponsor Logos Ensure sponsor logos don't go past the edge of the screen, and maintain aspect ratio when sized down. Signed-off-by: Hassan Abouelela --- pydis_site/static/css/home/index.css | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/static/css/home/index.css b/pydis_site/static/css/home/index.css index ee6f6e4c..7ec8af74 100644 --- a/pydis_site/static/css/home/index.css +++ b/pydis_site/static/css/home/index.css @@ -215,12 +215,20 @@ h1 { } #sponsors .columns { + display: block; justify-content: center; margin: auto; max-width: 80%; } +#sponsors a { + margin: auto; + display: inline-block; +} + #sponsors img { - height: 5rem; - margin: auto 1rem; + width: auto; + height: auto; + + max-height: 5rem; } -- cgit v1.2.3 From bc1aae035a25dca1a894e22421f493175edebac2 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Wed, 6 Oct 2021 02:18:39 +0400 Subject: Adds Netlify To Sponsors Signed-off-by: Hassan Abouelela --- pydis_site/static/images/sponsors/netlify.png | Bin 0 -> 177462 bytes pydis_site/templates/home/index.html | 4 ++++ 2 files changed, 4 insertions(+) create mode 100644 pydis_site/static/images/sponsors/netlify.png (limited to 'pydis_site') diff --git a/pydis_site/static/images/sponsors/netlify.png b/pydis_site/static/images/sponsors/netlify.png new file mode 100644 index 00000000..0f14f385 Binary files /dev/null and b/pydis_site/static/images/sponsors/netlify.png differ diff --git a/pydis_site/templates/home/index.html b/pydis_site/templates/home/index.html index 8e52274d..77037ef8 100644 --- a/pydis_site/templates/home/index.html +++ b/pydis_site/templates/home/index.html @@ -187,6 +187,10 @@ StreamYard + + + Netlify + Cloudflare -- cgit v1.2.3 From 81054bdd73c937f184fef828a8f3bacd6d30caaa Mon Sep 17 00:00:00 2001 From: Kronifer <44979306+Kronifer@users.noreply.github.com> Date: Tue, 5 Oct 2021 18:14:02 -0500 Subject: Merge Gitpod Docs (#594) docs: Added site documentation for editing on Gitpod --- .../resources/guides/pydis-guides/contributing/sir-lancebot.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pydis_site') diff --git a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/sir-lancebot.md b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/sir-lancebot.md index 068b08ae..60169c01 100644 --- a/pydis_site/apps/content/resources/guides/pydis-guides/contributing/sir-lancebot.md +++ b/pydis_site/apps/content/resources/guides/pydis-guides/contributing/sir-lancebot.md @@ -16,6 +16,15 @@ toc: 1 - [MacOS Installer](https://git-scm.com/download/mac) or `brew install git` - [Linux](https://git-scm.com/download/linux) +## Using Gitpod +Sir Lancebot can be edited and tested on Gitpod. Gitpod will automatically install the correct dependencies and Python version, so you can get straight to coding. +To do this, you will need a Gitpod account, which you can get [here](https://www.gitpod.io/#get-started), and a fork of Sir Lancebot. This guide covers forking the repository [here](#fork-the-project). Afterwards, either click the button on Sir Lancebot's README or go to [https://gitpod.io/#/python-discord/sir-lancebot]() and run the following commands in the terminal: +```sh +git remote rename origin upstream +git add remote origin https://github.com/{your_username}/sir-lancebot +``` +Make sure you replace `{your_username}` with your Github username. These commands will set Python Discord as the parent repository, and your branch as the fork. This means you can easily grab new changes from the parent repository. Once you set your environment variables to test your code, you are ready to begin contributing to Sir Lancebot. + ## Using Docker Sir Lancebot can be started using Docker. Using Docker is generally recommended (but not strictly required) because it abstracts away some additional set up work. -- cgit v1.2.3 From 8f596f3b5fd44a502efccc021ab4c50908da3d67 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 6 Oct 2021 00:18:37 +0100 Subject: Add www.pythondiscord.com to ALLOWED_HOSTS (#601) --- pydis_site/settings.py | 1 + 1 file changed, 1 insertion(+) (limited to 'pydis_site') diff --git a/pydis_site/settings.py b/pydis_site/settings.py index d2cd8698..656676da 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -55,6 +55,7 @@ else: ALLOWED_HOSTS = env.list( 'ALLOWED_HOSTS', default=[ + 'www.pythondiscord.com', 'pythondiscord.com', 'admin.pythondiscord.com', 'api.pythondiscord.com', -- cgit v1.2.3 From b5b49ef0ea9209ecc140302879383b619e694541 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 6 Oct 2021 00:35:59 +0100 Subject: Update hosts.py to default to www --- pydis_site/hosts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pydis_site') diff --git a/pydis_site/hosts.py b/pydis_site/hosts.py index 5a837a8b..719e93cf 100644 --- a/pydis_site/hosts.py +++ b/pydis_site/hosts.py @@ -9,5 +9,6 @@ host_patterns = patterns( # Internal API ingress (cluster local) host(r'pydis-api', 'pydis_site.apps.api.urls', name='internal_api'), host(r'staff', 'pydis_site.apps.staff.urls', name='staff'), - host(r'.*', 'pydis_site.apps.home.urls', name=settings.DEFAULT_HOST) + host(r'www', 'pydis_site.apps.home.urls', name=settings.DEFAULT_HOST), + host(r'.*', 'pydis_site.apps.home.urls', name="fallback") ) -- cgit v1.2.3