Include tag and templates with Apache & mod_wsgi

I’m new to Django and would appreciate any help/I can post any code if that would help with clarification.

In my website, I am displaying a map with coordinates plotted based on user selection within a form. If a user selects a different option in the form, then different coordinates are plotted on the map and displayed to the user. The map and form are on the same webpage with the map being displayed through a {% include path/to/map %} tag. The html file for the map is in my templates folder. The site works well when Debug=True, but fails otherwise. I believe I set the appropriate permissions (chown/chmod) to the project, static folder, and templates, but yet it still fails to work. I was wondering if there are any other changes I need to make for the server configuration or otherwise in order to get this to work?

If you’re using the include statement for this map, that implies it’s being handled as a template.

That’s different from and independent of any static file handling. (Which isn’t to say that that html isn’t pulling in static resources.)

You’re probably going to need to provide a lot more details here.

Have you read Deploying static files | Django documentation | Django?

Have you read Managing static files (e.g. images, JavaScript, CSS) | Django documentation | Django?
Specifically, be aware that the handling of static files between a development environment (with DEBUG=True) and a production environment is very different.

What are your static file-related settings?

  • STATIC_ROOT
  • STATIC_URL
  • STATICFILES_DIRS

What specifically is failing?
Are you getting any error messages?
Are you seeing 404s in your server log?

Hi Ken, thanks for your response. To clarify, I am not having an issue with static files, but rather as you mentioned, the map is being handled as a template. There are no error messages or 404 in my error logs.

The failure in my site occurs after a user submits the form that changes the map html file to include the new coordinates based on their submission. This change is not reflected in the map.html file that is within the include tag when DEBUG = False, but it is when DEBUG = True.