Map: Use standard Leaflet green/red pin icons for GPX route start/end markers in map_iframe_single.html
This commit is contained in:
@@ -263,7 +263,15 @@ def delete_post(post_id):
|
||||
|
||||
current_app.logger.info(f'Found post to delete: ID={post.id}, Title="{title}"')
|
||||
|
||||
|
||||
try:
|
||||
# Delete associated map route if exists
|
||||
from app.models import MapRoute
|
||||
map_route = MapRoute.query.filter_by(post_id=post.id).first()
|
||||
if map_route:
|
||||
db.session.delete(map_route)
|
||||
current_app.logger.info(f'Deleted MapRoute for post {post.id}')
|
||||
|
||||
# Delete associated files and records
|
||||
db.session.delete(post)
|
||||
db.session.commit()
|
||||
|
||||
@@ -4,16 +4,12 @@ services:
|
||||
app:
|
||||
build: .
|
||||
ports:
|
||||
- "5000:5000"
|
||||
- "8100:5000"
|
||||
environment:
|
||||
- FLASK_ENV=production
|
||||
- DATABASE_URL=postgresql://moto_user:moto_pass@db:5432/moto_adventure
|
||||
- SECRET_KEY=your-super-secret-key-change-this
|
||||
- MAIL_SERVER=smtp.gmail.com
|
||||
- MAIL_PORT=587
|
||||
- MAIL_USE_TLS=true
|
||||
- MAIL_USERNAME=your-email@gmail.com
|
||||
- MAIL_PASSWORD=your-app-password
|
||||
|
||||
volumes:
|
||||
- ./uploads:/opt/site/flask-moto-adventure/uploads
|
||||
depends_on:
|
||||
|
||||
36
nginx.conf
Normal file
36
nginx.conf
Normal file
@@ -0,0 +1,36 @@
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
# Proxy requests to the Flask app
|
||||
location / {
|
||||
proxy_pass http://app:5000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Serve uploaded media files
|
||||
location /uploads/ {
|
||||
alias /opt/site/flask-moto-adventure/uploads/;
|
||||
autoindex off;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user