Skip to content

Multiple upgrades to get the system working locally with docker and Django 3#310

Merged
mhall119 merged 6 commits intoGetTogetherComm:masterfrom
PyCampES:master
Apr 18, 2022
Merged

Multiple upgrades to get the system working locally with docker and Django 3#310
mhall119 merged 6 commits intoGetTogetherComm:masterfrom
PyCampES:master

Conversation

@dukebody
Copy link
Copy Markdown
Contributor

Update all needed packages to make the system work locally with modern Django 3.2.12 and docker.

Comment thread .pre-commit-config.yaml
language_version: python3
- repo: https://github.com/pre-commit/mirrors-isort
rev: "master" # Use the revision sha / tag you want to point at
rev: "main" # Use the revision sha / tag you want to point at
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

project switched to main branch naming

Comment thread Dockerfile
@@ -1,27 +1,16 @@
FROM python:3-alpine as builder
FROM python:3.9-slim
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alpine doesn't always play well with Python. See https://pythonspeed.com/articles/alpine-docker-python/

Comment thread Dockerfile

RUN apk add --no-cache zlib-dev build-base python-dev jpeg-dev
RUN pip install virtualenv
RUN virtualenv venv
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to use venvs within Docker really.

Comment thread README.md
In order to make it easier to create Places and Teams without having to manually
enter records for Country, SPR (State/Province/Region) and City, you can preload
them using data files from <http://download.geonames.org/export/dump/>
them using data files from <https://download.geonames.org/export/dump/>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many browsers will prefer https over http.

Comment thread docker-compose.yml
- SECRET_KEY=xxxxx
- ALLOWED_HOSTS=localhost,127.0.0.1
volumes:
- ./:/home/python No newline at end of file
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hot reload of changes without rebuilding the docker image.

<table>
{{ event_form }}
{{ event_form }}
{{ event_form.media }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for some widgets like recurrence.

Comment thread get_together/settings.py
"images": {"nav_logo": "img/logo_b_v1.png"},
}

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed in new Django to avoid warnings in runserver.

Comment thread get_together/urls.py
views.show_team_events_by_slug,
name="show-team-events-by-slug",
),
path('jsi18n.js', JavaScriptCatalog.as_view(packages=['recurrence']), name='jsi18n'),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed by django-recurrence to load pgettext.

Comment thread requirements.txt
Django==2.0.12
django-appconf==1.0.2
Django==3.2.13
django-appconf==1.0.5
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrades to work with Django 3 that doesn't include six.

Comment thread resume/apps.py

class ResumeConfig(AppConfig):
name = "Resume"
name = "resume"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed in Django 3 because it tried to import a module Resume that does not exist.

Copy link
Copy Markdown
Collaborator

@mhall119 mhall119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These all look good to me, thank you so much!

@mhall119 mhall119 merged commit 6708944 into GetTogetherComm:master Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants