You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Godaddy域名搭配DtDNS动态DNS部署Django站点出现空白页求助

Troubleshooting Blank Page for Django Site on Raspberry Pi via DtDNS/GoDaddy

Hey there, let's work through this blank page issue step by step—since your local setup runs perfectly on Apache + mod_wsgi, the problem is almost certainly tied to public-facing routing or configuration gaps. Here's what to check:

  • Verify Dynamic DNS Resolution
    First, confirm your DtDNS domain is pointing to the correct public IP. Grab your Pi's public IP with curl ifconfig.me, then from a device off your home network (like a phone on cellular), run nslookup your-dtdns-domain.com or dig your-dtdns-domain.com. If the returned IP doesn't match your Pi's, double-check your DtDNS update script on the Pi—ensure it's running on schedule and has valid authentication credentials.

  • Check Router Port Forwarding
    Your router needs to forward incoming HTTP (port 80) and/or HTTPS (port 443) traffic to your Pi's local IP. Make sure:

    • The local IP of your Pi is static (use DHCP reservation in your router or set it via /etc/dhcpcd.conf on the Pi to avoid IP changes breaking the rule)
    • The port forwarding rule targets the correct local IP and ports
    • Some ISPs block port 80—if you hit this, try using a non-standard port (like 8080) for forwarding, then access your site as your-domain.com:8080
  • Validate Apache Configuration
    Local success doesn't mean public-facing config is right:

    • Ensure your <VirtualHost> block listens on *:80 (not just localhost:80) so Apache accepts requests from outside your network
    • Set the ServerName directive in your virtual host to match your GoDaddy/DtDNS domain
    • Confirm WSGIScriptAlias points to the correct path of your Django project's wsgi.py file
    • Check file permissions: Apache's user (usually www-data) needs read access to your Django project files. Run sudo chown -R www-data:www-data /path/to/your/django/project if needed
    • Test config validity with sudo apache2ctl configtest and restart Apache with sudo systemctl restart apache2
  • Local Firewall Rules
    If you have ufw enabled on the Pi, make sure it allows incoming traffic on ports 80/443:

    sudo ufw allow 80/tcp
    sudo ufw allow 443/tcp
    sudo ufw reload
    

    Verify active rules with sudo ufw status

  • Browser & Network Debugging

    • Access your site in incognito/private mode to rule out cached blank responses
    • Open your browser's developer tools (Network tab) to check the HTTP status code:
      • 200: Server responded, but content isn't rendering—check Django's templates or static files configuration
      • 404/500: Server-side error—look at Apache's error logs for details
      • 3xx: Redirect loop or misconfigured redirects
    • If you get no response at all, your traffic isn't reaching the Pi—circle back to port forwarding and DNS checks
  • Dig Into Logs
    Logs are your best friend here. Tail Apache's error log while accessing the site to catch real-time issues:

    sudo tail -f /var/log/apache2/error.log
    

    Check the access log to confirm requests are hitting the Pi:

    sudo tail -f /var/log/apache2/access.log
    

内容的提问来源于stack exchange,提问作者JulienK

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:40:53