Replies: 2 comments
-
Here's how you might approach this: Custom GraphQL Field: In your GraphQL schema, you could create a custom field that resolves to the correct static URL for your subdirectory. This field would essentially generate the correct URL for each static asset based on the unique URL structure you want. For example, your schema might have something like:
Template Tag or Utility Function: Create a template tag or utility function that generates the correct URL for a given static asset. This would be similar to the {% static %} template tag in Django but customized for your unique URL structure. For example, you could create a template tag called {% custom_static %}:
Then in your templates:
These approaches involve customizing how static URLs are generated based on your unique URL structure. Keep in mind that this customization might also require adjustments to how you serve these static files during development and deployment. You might need to configure your web server (e.g., Apache, Nginx) to handle requests to the /transport/front_static/ URL and map them to your static files. |
Beta Was this translation helpful? Give feedback.
-
I never use django and I couldn't understand your question。 |
Beta Was this translation helpful? Give feedback.
-
IN URI "/" all exapels work fine but on other urls
http://localhost:5800/**transport**/front_static/img/icons.svg?v=1692345230923 - it can't fide static and I understand wy, but how can i ask all static on http://localhost:5800/front_static/ something like {% static '......' %} in django
Beta Was this translation helpful? Give feedback.
All reactions