mirror of
https://github.com/kennethreitz/kennethreitz.org.git
synced 2026-06-05 22:50:17 +00:00
test
This commit is contained in:
+4
-3
@@ -8,10 +8,11 @@ services:
|
||||
volumes:
|
||||
- .:/app
|
||||
environment:
|
||||
- FLASK_ENV=production
|
||||
- FLASK_ENV=development
|
||||
- DISABLE_ANALYTICS=true
|
||||
restart: unless-stopped
|
||||
# Use Gunicorn with gevent workers for better async performance
|
||||
command: ["gunicorn", "--bind", "0.0.0.0:8000", "--worker-class", "gevent", "--workers", "4", "--worker-connections", "1000", "--timeout", "60", "engine:app"]
|
||||
# Use single worker for local development
|
||||
command: ["gunicorn", "--bind", "0.0.0.0:8000", "--worker-class", "gevent", "--workers", "1", "--worker-connections", "1000", "--timeout", "60", "--reload", "engine:app"]
|
||||
|
||||
# Alternative dev configuration - uncomment to use Flask dev server
|
||||
# web-dev:
|
||||
|
||||
@@ -12,6 +12,9 @@ import html
|
||||
|
||||
app = Flask(__name__, template_folder='templates')
|
||||
|
||||
# Configuration
|
||||
app.config['DISABLE_ANALYTICS'] = os.environ.get('DISABLE_ANALYTICS', 'false').lower() == 'true'
|
||||
|
||||
# Add custom Jinja2 filters
|
||||
@app.template_filter('strftime')
|
||||
def strftime_filter(date, fmt='%Y-%m-%d'):
|
||||
|
||||
@@ -805,6 +805,7 @@
|
||||
{% block extra_head %}{% endblock %}
|
||||
|
||||
<!-- Analytics -->
|
||||
{% if not (config.get('DISABLE_ANALYTICS') or request.environ.get('DISABLE_ANALYTICS')) %}
|
||||
<script type="text/javascript">
|
||||
var _gauges = _gauges || [];
|
||||
(function() {
|
||||
@@ -819,6 +820,7 @@
|
||||
s.parentNode.insertBefore(t, s);
|
||||
})();
|
||||
</script>
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
<article>
|
||||
|
||||
Reference in New Issue
Block a user