Skip to content
Merged

Tom #84

Show file tree
Hide file tree
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
138 changes: 125 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,22 @@ env.py
# Django
*.log
db.sqlite3
db.sqlite3-journal
media/
staticfiles/
local_settings.py
settings_local.py

# VS Code
.vscode/
*.code-workspace

# PyCharm
.idea/

# Sublime Text
*.sublime-project
*.sublime-workspace

# Node.js / Frontend
node_modules/
Expand All @@ -32,10 +41,18 @@ yarn-error.log*
build/
dist/
*.tgz
package-lock.json
yarn.lock

# OS files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
Desktop.ini

# Coverage reports
htmlcov/
Expand All @@ -46,25 +63,120 @@ nosetests.xml
coverage.xml
*.cover
*.py,cover
.pytest_cache/
.tox/

# Migrations
# Migrations (be careful with this - usually want to commit migrations)
# Only ignore compiled Python in migrations
**/migrations/__pycache__/
**/migrations/*.pyc
**/migrations/*.pyo
**/migrations/*.pyd
**/migrations/__pycache__/
**/migrations/*.sqlite3

# Others
# Backup files
*.bak
*.swp
*.swo
*.csv
*~

# Windows OS files
Thumbs.db
ehthumbs.db
Desktop.ini
# Celery
celerybeat-schedule
celerybeat.pid

# Python Windows environments
Scripts/
.venv/
env.py
# SQLite database files
*.sqlite
*.sqlite3
*.db

# Media files (uploaded content)
media/
*.jpg
*.jpeg
*.png
*.gif
*.pdf
*.mp4
*.mov
*.avi
*.webm

# Temporary files
*.tmp
*.temp

# MacOS
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.TemporaryItems
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# pipenv
Pipfile.lock

# poetry
poetry.lock

# pdm
.pdm.toml

# PEP 582
__pypackages__/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# Sentry
.sentryclirc

# Webpack
webpack-stats.json

# Redis
dump.rdb

# Logs
logs/
*.log

# SSL certificates (if storing locally)
*.pem
*.key
*.crt
*.csr

# Environment-specific files
.envrc
.env.local
.env.*.local
40 changes: 32 additions & 8 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
import os
import dj_database_url
import sys
from dotenv import load_dotenv


# Load .env file
load_dotenv()


# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand All @@ -12,6 +18,7 @@
import env

SECRET_KEY = os.environ.get("SECRET_KEY")
GOOGLE_MAPS_API_KEY = os.environ.get('GOOGLE_MAPS_API_KEY')
DEBUG = True
ALLOWED_HOSTS = [
"deanery-11c659a713eb.herokuapp.com",
Expand Down Expand Up @@ -123,6 +130,10 @@
STATICFILES_DIRS = [BASE_DIR / 'staticfiles']
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

# Add MEDIA configuration
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

if sys.platform == "win32":
Expand All @@ -138,11 +149,24 @@
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DEFAULT_FROM_EMAIL = 'noreply@ncd.com'

# For production, configure a real email backend, HERE:
# EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# EMAIL_HOST = 'smtp.yourprovider.com' # e.g., 'smtp.gmail.com'
# EMAIL_PORT = 587 # or 465 for SSL
# EMAIL_HOST_USER = 'your@email.com'
# EMAIL_HOST_PASSWORD = 'your-email-password'
# EMAIL_USE_TLS = True # True for port 587, False for 465
# DEFAULT_FROM_EMAIL = 'your@email.com'
# For production - uncomment and configure:
if not DEBUG:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = os.environ.get('EMAIL_HOST', 'smtp.gmail.com')
EMAIL_PORT = int(os.environ.get('EMAIL_PORT', 587))
EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', 'noreply@ncd.com')

# Security settings for production
if not DEBUG:
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_BROWSER_XSS_FILTER = True
SECURE_CONTENT_TYPE_NOSNIFF = True
X_FRAME_OPTIONS = 'DENY'
SECURE_HSTS_SECONDS = 31536000
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_PRELOAD = True
3 changes: 3 additions & 0 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from django.urls import path, include
from django.conf import settings
from django.views.generic import TemplateView
from django.conf.urls.static import static

urlpatterns = [
path('admin/', admin.site.urls),
Expand All @@ -30,3 +31,5 @@
urlpatterns += [
path("__reload__/", include("django_browser_reload.urls")),
]
# media files serving in development
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
19 changes: 19 additions & 0 deletions docs/OLDNorthCarnmarthDeaneryLocations.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Location,Name,Address,Postcode,Latitude,Longitude,Contact
Camborne,St Martins & Meriadoc's Church,TR14 7DF,50.21366877043699,-5.301824086944084,,
Tuckingmill,All Saints Church,TR14 8RQ,50.22018118627777,-5.28559548851654,,
Penponds,Holy Trinity Church,TR14 0QE,50.2069714041776,-5.315726981398124,,
Crowan,Crowan Church,TR14 9NB,50.1637994385378,-5.297747715781878,,
Treslothan,Treslothan Church,TR14 9LP,50.19979459265355,-5.296158532971124,,
St Day,Holy Trinity Church,33 Church St Redruth,TR16 5LD,50.2375012032268,-5.183848071600855,01209 822862,
Carharrack,St Pirans Mission Church,TR16 5RP,50.22932300343052,-5.181982517627701,,
Gwennap,St Wenappa Church,TR16 6BD,50.21784792863372,-5.170980531121604,,
Chacewater,St Pauls Church,TR4 8PZ,50.2538404644562,-5.1565885605074975,,
Stithians,St Stythians Church,TR3 7RN,50.19078249192517,-5.179857640256757,,
St Andrews,St Andrews Church,TR15 2LL,50.23179708057995,-5.2256908348185105,,
St Euny,St Euny Church,TR15 3BT,50.22613250475454,-5.238225500436913,,
Pencoys,St Andrews Church,TR16 6LT,50.19936321351329,-5.241719334819983,,
Lanner,Christ Church,TR16 6ER,50.21405614336509,-5.204804504135002,,
Treleigh,St Stephens Church,TR16 4AY,50.24735827059275,-5.221079258107016,,
Illogan,St Illogan Parish Church,TR16 4SR,50.24995225224803,-5.267790936114373,,
Trevenson,Trevenson Church (St Illogan),TR15 3PT,50.23090881484769,-5.273534963967737,,
Portreath,St Mary’s Church,TR16 4LW,50.26128781853588,-5.28668583111962,,
Loading