Skip to content

Commit 4005e7d

Browse files
committed
feat: restructure app
1 parent 097df08 commit 4005e7d

File tree

990 files changed

+10561
-10691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

990 files changed

+10561
-10691
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ jobs:
3838
cache-name: pythondotorg-cache-pip
3939
with:
4040
path: ~/.cache/pip
41-
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
41+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements/requirements.txt', 'requirements/*-requirements.txt') }}
4242
restore-keys: |
4343
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
4444
${{ runner.os }}-${{ github.job }}-
4545
${{ runner.os }}-
4646
- name: Install Python dependencies
4747
run: |
4848
pip install -U pip setuptools wheel
49-
pip install -r dev-requirements.txt
49+
pip install -r requirements/dev-requirements.txt
5050
- name: Check for ungenerated database migrations
5151
run: |
5252
python manage.py makemigrations --check --dry-run

.github/workflows/static.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
cache-name: pythondotorg-cache-pip
1616
with:
1717
path: ~/.cache/pip
18-
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
18+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements/requirements.txt', 'requirements/*-requirements.txt') }}
1919
restore-keys: |
2020
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
2121
${{ runner.os }}-${{ github.job }}-
2222
${{ runner.os }}-
2323
- name: Install Python dependencies
2424
run: |
2525
pip install -U pip setuptools wheel
26-
pip install -r requirements.txt -r prod-requirements.txt
26+
pip install -r requirements/requirements.txt -r requirements/prod-requirements.txt
2727
- name: Run Tests
2828
run: |
2929
DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
.sass-cache/
1313
docs/build
14-
media/*
14+
app/media/*
1515
static-root/
1616
static/stylesheets/mq.css
1717
static/stylesheets/no-mq.css

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ build:
1010
python: "3"
1111

1212
commands:
13-
- python -m pip install -r docs-requirements.txt
13+
- python -m pip install -r requirements/docs-requirements.txt
1414
- make -C docs html JOBS=$(nproc) BUILDDIR=_readthedocs
1515
- mv docs/_readthedocs _readthedocs

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ RUN case $(uname -m) in \
3232
RUN mkdir /code
3333
WORKDIR /code
3434

35-
COPY dev-requirements.txt /code/
36-
COPY base-requirements.txt /code/
37-
COPY prod-requirements.txt /code/
38-
COPY requirements.txt /code/
35+
COPY requirements/dev-requirements.txt /code/
36+
COPY requirements/base-requirements.txt /code/
37+
COPY requirements/prod-requirements.txt /code/
38+
COPY requirements/requirements.txt /code/
3939

4040
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
4141

Dockerfile.cabotage

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ RUN case $(uname -m) in \
3333
RUN mkdir /code
3434
WORKDIR /code
3535

36-
COPY dev-requirements.txt /code/
37-
COPY base-requirements.txt /code/
38-
COPY prod-requirements.txt /code/
39-
COPY requirements.txt /code/
36+
COPY requirements/dev-requirements.txt /code/
37+
COPY requirements/base-requirements.txt /code/
38+
COPY requirements/prod-requirements.txt /code/
39+
COPY requirements/requirements.txt /code/
4040

4141
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
4242

@@ -46,4 +46,4 @@ RUN --mount=type=cache,target=/root/.cache/pip \
4646
install \
4747
-r requirements.txt -r prod-requirements.txt
4848
COPY . /code/
49-
RUN DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput
49+
RUN DJANGO_SETTINGS_MODULE=pydotorg.settings.static python app/manage.py collectstatic --noinput

Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ default:
88
@echo
99
@exit 1
1010

11-
.state/docker-build-web: Dockerfile dev-requirements.txt base-requirements.txt
11+
.state/docker-build-web: Dockerfile requirements/dev-requirements.txt requirements/base-requirements.txt
1212
# Build web container for this project
1313
docker compose build --force-rm web
1414

@@ -24,7 +24,7 @@ default:
2424

2525
.state/db-initialized: .state/docker-build-web .state/db-migrated
2626
# Load all fixtures
27-
docker compose run --rm web ./manage.py loaddata fixtures/*.json
27+
docker compose run --rm web ./app/manage.py loaddata fixtures/*.json
2828

2929
# Mark the state so we don't rebuild this needlessly.
3030
mkdir -p .state && touch .state/db-initialized
@@ -34,25 +34,25 @@ serve: .state/db-initialized
3434

3535
migrations: .state/db-initialized
3636
# Run Django makemigrations
37-
docker compose run --rm web ./manage.py makemigrations
37+
docker compose run --rm web ./app/manage.py makemigrations
3838

3939
migrate: .state/docker-build-web
4040
# Run Django migrate
41-
docker compose run --rm web ./manage.py migrate
41+
docker compose run --rm web ./app/manage.py migrate
4242

4343
manage: .state/db-initialized
4444
# Run Django manage to accept arbitrary arguments
45-
docker compose run --rm web ./manage.py $(filter-out $@,$(MAKECMDGOALS))
45+
docker compose run --rm web ./app/manage.py $(filter-out $@,$(MAKECMDGOALS))
4646

4747
shell: .state/db-initialized
48-
docker compose run --rm web ./manage.py shell
48+
docker compose run --rm web ./app/manage.py shell
4949

5050
clean:
5151
docker compose down -v
5252
rm -f .state/docker-build-web .state/db-initialized .state/db-migrated
5353

5454
test: .state/db-initialized
55-
docker compose run --rm web ./manage.py test
55+
docker compose run --rm web ./app/manage.py test
5656

5757
docker_shell: .state/db-initialized
5858
docker compose run --rm web /bin/bash

Procfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
release: python manage.py migrate --noinput
1+
release: python app/manage.py migrate --noinput
22
web: bin/start-nginx gunicorn -c gunicorn.conf pydotorg.wsgi
3-
worker: celery -A pydotorg worker -l INFO
3+
worker: celery -A app.pydotorg worker -l INFO
44
worker-beat: celery -A pydotorg beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
File renamed without changes.
File renamed without changes.

banners/admin.py app/banners/admin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from django.contrib import admin
22

3-
from banners.models import Banner
3+
from app.banners.models import Banner
44

55

66
@admin.register(Banner)

banners/apps.py app/banners/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
class BannersAppConfig(AppConfig):
55

6-
name = 'banners'
6+
name = 'app.banners'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

banners/templatetags/banners.py app/banners/templatetags/banners.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django import template
22
from django.template.loader import render_to_string
33

4-
from banners.models import Banner
4+
from app.banners.models import Banner
55

66
register = template.Library()
77

File renamed without changes.
File renamed without changes.
File renamed without changes.

blogs/admin.py app/blogs/admin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django.contrib import admin
22
from django.core.management import call_command
33

4-
from .models import BlogEntry, Feed, FeedAggregate
4+
from app.blogs.models import BlogEntry, Feed, FeedAggregate
55

66

77
@admin.register(BlogEntry)

blogs/apps.py app/blogs/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
class BlogsAppConfig(AppConfig):
55

6-
name = 'blogs'
6+
name = 'app.blogs'

blogs/factories.py app/blogs/factories.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from django.conf import settings
22

3-
from .models import Feed
3+
from app.blogs.models import Feed
44

55

66
def initial_data():
File renamed without changes.
File renamed without changes.

blogs/management/commands/update_blogs.py app/blogs/management/commands/update_blogs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from django.core.management.base import BaseCommand
22
from django.utils.timezone import now
33

4-
from ...models import BlogEntry, RelatedBlog, Feed
5-
from ...parser import get_all_entries, update_blog_supernav
4+
from app.blogs..models import BlogEntry, RelatedBlog, Feed
5+
from app.blogs..parser import get_all_entries, update_blog_supernav
66

77

88
class Command(BaseCommand):
File renamed without changes.
File renamed without changes.

blogs/models.py app/blogs/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from django.db import models
77

8-
from cms.models import ContentManageable
8+
from app.cms.models import ContentManageable
99

1010

1111
def tag_visible(element):

blogs/parser.py app/blogs/parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from django.template.loader import render_to_string
66
from django.utils.timezone import make_aware
77

8-
from boxes.models import Box
9-
from .models import BlogEntry, Feed
8+
from app.boxes.models import Box
9+
from app.blogs.models import BlogEntry, Feed
1010

1111

1212
def get_all_entries(feed_url):
File renamed without changes.
File renamed without changes.
File renamed without changes.

blogs/templatetags/blogs.py app/blogs/templatetags/blogs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from django import template
22

3-
from ..models import BlogEntry
3+
from app.blogs.models import BlogEntry
44

55
register = template.Library()
66

File renamed without changes.

0 commit comments

Comments
 (0)