Skip to content

Commit 74cb445

Browse files
authored
enable customizing admin (#2263)
psf staff spend a lot of time between us.pycon.org and python.org django admin this enables configuration of a different theme for python.org so its easier to differentiate. thanks to @swiencks for pointing out how easy to confuse they are.
1 parent 88d42f7 commit 74cb445

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

base-requirements.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
dj-database-url==0.5.0
22
django-pipeline==2.0.6
33
django-sitetree==1.17.0
4+
django-apptemplates==1.5
5+
django-admin-interface==0.24.2
6+
django-translation-aliases==0.1.0
47
Django==2.2.24
58
docutils==0.12
69
Markdown==3.3.4
710
cmarkgfm==0.6.0
8-
Pillow==8.3.1
11+
Pillow==9.4.0
912
psycopg2-binary==2.8.6
1013
python3-openid==3.2.0
1114
python-decouple==3.4

pydotorg/settings/base.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,12 @@
9494
'DIRS': [
9595
TEMPLATES_DIR,
9696
],
97-
'APP_DIRS': True,
9897
'OPTIONS': {
98+
'loaders': [
99+
'apptemplates.Loader',
100+
'django.template.loaders.filesystem.Loader',
101+
'django.template.loaders.app_directories.Loader',
102+
],
99103
'context_processors': [
100104
'django.template.context_processors.debug',
101105
'django.template.context_processors.i18n',
@@ -151,10 +155,14 @@
151155
'django.contrib.redirects',
152156
'django.contrib.messages',
153157
'django.contrib.staticfiles',
158+
'django.contrib.humanize',
159+
160+
'admin_interface',
161+
'colorfield',
154162
'django.contrib.admin',
155163
'django.contrib.admindocs',
156-
'django.contrib.humanize',
157164

165+
'django_translation_aliases',
158166
'pipeline',
159167
'sitetree',
160168
'imagekit',
@@ -288,7 +296,8 @@
288296

289297
### SecurityMiddleware
290298

291-
X_FRAME_OPTIONS = 'DENY'
299+
X_FRAME_OPTIONS = 'SAMEORIGIN'
300+
SILENCED_SYSTEM_CHECKS = ["security.W019"]
292301

293302
### django-rest-framework
294303

pydotorg/settings/heroku.py

-12
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,6 @@
2020
}
2121
}
2222

23-
HAYSTACK_SEARCHBOX_SSL_URL = config(
24-
'SEARCHBOX_SSL_URL'
25-
)
26-
27-
HAYSTACK_CONNECTIONS = {
28-
'default': {
29-
'ENGINE': 'haystack.backends.elasticsearch5_backend.Elasticsearch5SearchEngine',
30-
'URL': HAYSTACK_SEARCHBOX_SSL_URL,
31-
'INDEX_NAME': 'haystack-prod',
32-
},
33-
}
34-
3523
SECRET_KEY = config('SECRET_KEY')
3624

3725
ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())

templates/admin/base_site.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "admin/base.html" %}
1+
{% extends "admin_interface:admin/base_site.html" %}
22
{% load i18n %}
33

44
{% block title %}{{ title }} | {% trans 'python.org' %}{% endblock %}

0 commit comments

Comments
 (0)