-
Notifications
You must be signed in to change notification settings - Fork 19
feat(talks): add 3D Earth globe for Djangonaut talks worldwide #640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Mitchina
wants to merge
8
commits into
develop
Choose a base branch
from
feature/3d-earth-talks-map
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
008ca88
feat(talks): add 3D Earth globe for Djangonaut talks worldwide
Mitchina 3196a42
ci(build): add GDAL system libraries to Github Actions
Mitchina 0fbfe83
fix(playwright): fix timezone test to work reliably in CI/local
Mitchina e68a9e2
fix: fixes after review
Mitchina 00af66c
Merge branch 'develop' into feature/3d-earth-talks-map
Mitchina 66d956c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 090e38c
fix: migrations files
Mitchina bb60072
Merge remote-tracking branch 'origin/feature/3d-earth-talks-map' into…
Mitchina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # Post-Map Page Setup (For Existing DB Users) | ||
|
|
||
| After pulling the branch with the map page, follow these steps if you have **existing PostgreSQL data**. | ||
|
|
||
| ## Changes Made | ||
|
|
||
| - **Dockerfile**: Added `libgdal-dev g++ gdal-bin libpq-dev` for GDAL compilation | ||
| - **pyproject.toml**: Added GDAL pinned to `3.6.2` (matches Debian bookworm) | ||
| - **docker-compose.yml**: Database image changed from `postgres:17` to `postgis/postgis:17-3.5` (include PostGIS binaries) - | ||
| **Image change doesn't touch your data, your volume mount stays identical** | ||
| - **`.env.template.local`, `.env.template`, `.env.template.docker`**: Have the `DATABASE_URL` changed from `postgres://` to **`postgis://`** | ||
| - **Django migrations**: `home/migrations/0049_talk_talkspeaker.py` automatically runs `CREATE EXTENSION IF NOT EXISTS postgis;` during `python manage.py migrate` - **no manual psql command needed** | ||
|
|
||
| Note: The postgres:// → postgis:// change was updated across ALL active config files (`.env` templates, `.github/workflows/tests.yml`, etc.) except `docs/archive/hetzner-migration.md` (archived doc). | ||
|
|
||
| ## Required Actions (Preserves Your Data) | ||
| ### ⚠️ Update Your .env File | ||
| #### Copy the **NEW** template to update DATABASE_URL: | ||
| Copy in Linux: | ||
| ```sh | ||
| cp .env.template.local .env | ||
| ``` | ||
| Copy in Windows: | ||
| ```sh | ||
| copy .env.template.local .env | ||
| ``` | ||
|
|
||
| #### Check the `DATABASE_URL` variable change in the .env: | ||
| from: | ||
| ``` | ||
| DATABASE_URL=postgres://djangonaut:djangonaut@localhost:5432/djangonaut-space | ||
| ``` | ||
| to: | ||
| ``` | ||
| DATABASE_URL=postgis://djangonaut:djangonaut@localhost:5432/djangonaut-space | ||
| ``` | ||
|
|
||
|
|
||
| ## ⚠️ NEW: Install System Libraries (Non-Docker Users) | ||
|
|
||
| ### **Map page requires GDAL/PostGIS libraries:** | ||
|
|
||
| **Linux (Debian/Ubuntu):** | ||
| ```sh | ||
| sudo apt install libgdal-dev gdal-bin libpq5 | ||
| ``` | ||
|
|
||
| ## If using Docker: | ||
| ### Rebuild & Restart Services | ||
| ```sh | ||
| docker compose build --no-cache # Rebuilds with GDAL libraries | ||
| docker compose up -d db # Restart DB with PostGIS image | ||
| ``` | ||
|
|
||
| ### Fix Collation Mismatch (One-time) | ||
| Collation fix is a one-time operation - handle it manually after switching images: | ||
| ```sh | ||
| docker compose exec db psql -U djangonaut -d djangonaut -c "ALTER DATABASE djangonaut REFRESH COLLATION VERSION;" | ||
| ``` | ||
|
|
||
| ### OPTIONAL - Silence template1 and postgres warnings: | ||
| ```sh | ||
| docker compose exec db psql -U djangonaut -d template1 -c "ALTER DATABASE template1 REFRESH COLLATION VERSION;" | ||
| docker compose exec db psql -U djangonaut -d postgres -c "ALTER DATABASE postgres REFRESH COLLATION VERSION;" | ||
| ``` | ||
|
|
||
| ### Start Full Stack | ||
| ```sh | ||
| docker compose up -d | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| from django.contrib.gis.geos import Point | ||
|
|
||
| DATE_INPUT_FORMAT = ["%Y-%m-%d", "%m/%d/%Y", "%m/%d/%y", "%d/%m/%y", "%d/%m/%Y"] | ||
|
|
||
| SURVEY_FIELD_VALIDATORS = { | ||
| "max_length": {"email": 250, "text": 700, "text_area": 700, "url": 250}, | ||
| "min_length": {"text_area": 1, "text": 1}, | ||
| } | ||
|
|
||
| SRID_WGS84 = 4326 # WGS84 standard (lat/lon coordinates) | ||
|
|
||
| # Conventional "unknown location" coordinate (0°N, 0°E, WGS84) | ||
| NULL_ISLAND = Point(0, 0, srid=SRID_WGS84) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| # Generated by Django 5.2.8 on 2026-01-25 13:53 | ||
|
|
||
| import django.contrib.gis.db.models.fields | ||
| import django.db.models.deletion | ||
| import modelcluster.fields | ||
| import uuid | ||
| from django.conf import settings | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("home", "0048_create_testimonial_model"), | ||
| migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RunSQL( | ||
| "CREATE EXTENSION IF NOT EXISTS postgis;", | ||
| reverse_sql=migrations.RunSQL.noop, # Does nothing when rolled back | ||
| ), | ||
|
Comment on lines
+19
to
+22
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be replaced with CreateExtension("postgis"), |
||
| migrations.CreateModel( | ||
| name="Talk", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| models.AutoField( | ||
| auto_created=True, | ||
| primary_key=True, | ||
| serialize=False, | ||
| verbose_name="ID", | ||
| ), | ||
| ), | ||
| ( | ||
| "uuid", | ||
| models.UUIDField(default=uuid.uuid4, editable=False, unique=True), | ||
| ), | ||
| ("title", models.CharField(max_length=255, verbose_name="title")), | ||
| ( | ||
| "description", | ||
| models.TextField( | ||
| blank=True, | ||
| help_text="Provide a brief summary of the talk.", | ||
| verbose_name="description", | ||
| ), | ||
| ), | ||
| ("date", models.DateField()), | ||
| ( | ||
| "talk_type", | ||
| models.CharField( | ||
| choices=[("on_site", "On-Site"), ("online", "Online")], | ||
| default="on_site", | ||
| help_text="Select the format of the talk.", | ||
| max_length=12, | ||
| verbose_name="talk Format", | ||
| ), | ||
| ), | ||
| ( | ||
| "event_name", | ||
| models.CharField( | ||
| help_text="Please provide the name of the event where the talk was held.", | ||
| max_length=255, | ||
| verbose_name="event name", | ||
| ), | ||
| ), | ||
| ( | ||
| "video_link", | ||
| models.URLField( | ||
| blank=True, | ||
| default="", | ||
| max_length=1024, | ||
| verbose_name="video Link", | ||
| ), | ||
| ), | ||
| ("address", models.CharField(blank=True, max_length=250, null=True)), | ||
| ( | ||
| "location", | ||
| django.contrib.gis.db.models.fields.PointField( | ||
| blank=True, null=True, srid=4326 | ||
| ), | ||
| ), | ||
| ], | ||
| options={ | ||
| "abstract": False, | ||
| }, | ||
| ), | ||
| migrations.CreateModel( | ||
| name="TalkSpeaker", | ||
| fields=[ | ||
| ( | ||
| "id", | ||
| models.AutoField( | ||
| auto_created=True, | ||
| primary_key=True, | ||
| serialize=False, | ||
| verbose_name="ID", | ||
| ), | ||
| ), | ||
| ( | ||
| "sort_order", | ||
| models.IntegerField(blank=True, editable=False, null=True), | ||
| ), | ||
| ( | ||
| "speaker", | ||
| models.ForeignKey( | ||
| on_delete=django.db.models.deletion.CASCADE, | ||
| to=settings.AUTH_USER_MODEL, | ||
| ), | ||
| ), | ||
| ( | ||
| "talk", | ||
| modelcluster.fields.ParentalKey( | ||
| on_delete=django.db.models.deletion.CASCADE, | ||
| related_name="speakers", | ||
| to="home.talk", | ||
| ), | ||
| ), | ||
| ], | ||
| options={ | ||
| "unique_together": {("talk", "speaker")}, | ||
| }, | ||
| ), | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused by the purpose of this file. Can you help me understand it please?