Skip to content
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

Revert "Improve static deploy" #2621

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -2,4 +2,3 @@ release: python manage.py migrate --noinput
web: bin/start-nginx gunicorn -c gunicorn.conf pydotorg.wsgi
worker: celery -A pydotorg worker -l INFO
worker-beat: celery -A pydotorg beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
postdeploy: python manage.py postdeploy
20 changes: 0 additions & 20 deletions fastly/utils.py
Original file line number Diff line number Diff line change
@@ -20,23 +20,3 @@ def purge_url(path):
return response

return None


def purge_surrogate_key(key):
"""
Purge a Fastly.com Surrogate-Key given a key.
"""
if settings.DEBUG:
return

api_key = getattr(settings, 'FASTLY_API_KEY', None)
service_id = getattr(settings, 'FASTLY_SERVICE_ID', None)
if api_key and service_id:
response = requests.request(
"POST",
f'https://api.fastly.com/service/{service_id}/purge/{key}',
headers={'Fastly-Key': api_key},
)
return response

return None
Empty file removed pydotorg/management/__init__.py
Empty file.
Empty file.
14 changes: 0 additions & 14 deletions pydotorg/management/commands/postdeploy.py

This file was deleted.

10 changes: 2 additions & 8 deletions pydotorg/settings/base.py
Original file line number Diff line number Diff line change
@@ -285,10 +285,8 @@
MAILING_LIST_PSF_MEMBERS = "[email protected]"

### Fastly ###
FASTLY_SERVICE_ID = False # Set to a Fastly Service ID in production to allow
# purges by Surrogate-Key
FASTLY_API_KEY = False # Set to Fastly API key in production to allow
# pages to be purged on save
FASTLY_API_KEY = False # Set to Fastly API key in production to allow pages to
# be purged on save

# Jobs
JOB_THRESHOLD_DAYS = 90
@@ -351,10 +349,6 @@

GLOBAL_SURROGATE_KEY = 'pydotorg-app'

### pydotorg.settings.cabotage.add_surrogate_keys_to_static

STATIC_SURROGATE_KEY = 'pydotorg-static'

### PyCon Integration for Sponsor Voucher Codes
PYCON_API_KEY = config("PYCON_API_KEY", default="deadbeef-dead-beef-dead-beefdeadbeef")
PYCON_API_SECRET = config("PYCON_API_SECRET", default="deadbeef-dead-beef-dead-beefdeadbeef")
8 changes: 1 addition & 7 deletions pydotorg/settings/cabotage.py
Original file line number Diff line number Diff line change
@@ -53,11 +53,6 @@
},
}

def add_surrogate_keys_to_static(headers, path, url):
headers['Surrogate-Key'] = STATIC_SURROGATE_KEY

WHITENOISE_ADD_HEADERS_FUNCTION = add_surrogate_keys_to_static

EMAIL_HOST = config('EMAIL_HOST')
EMAIL_HOST_USER = config('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')
@@ -68,8 +63,7 @@ def add_surrogate_keys_to_static(headers, path, url):
PEP_REPO_PATH = None
PEP_ARTIFACT_URL = config('PEP_ARTIFACT_URL')

# Fastly
FASTLY_SERVICE_ID = config('FASTLY_SERVICE_ID')
# Fastly API Key
FASTLY_API_KEY = config('FASTLY_API_KEY')

SECURE_SSL_REDIRECT = True