Locating Dynamically Changing Files in My Testhys App

14 views
Skip to first unread message

haonr...@gmail.com

unread,
Aug 14, 2015, 6:34:09 PM8/14/15
to Tethys Platform
Hello,

I have a question regarding dynamically putting files into a Tethys App I have created and having a way to reference those files programatically in my JQuery. I have folders that are uploaded at different times to my app into a subfolder of the Public directory; these folders contain css, jquery, javascript, and html. The problem I am facing is that I can use my controller.py to find these paths serverside and reference but when I pass these locations through to the html, the paths I am passing are absolute paths on the server. What I need is to be able to pass the location relative to the domain of my app. I was told that since I am placing the files in my Public folder of my app, that I would need to run collectstatic each time so that I can capture these locations on my app domain so that the potential user that is not serverside could reference said html. Does that make sense? Is there a way to find these files without running collectstatic? 

Any input is appreciated :)

Noah

sdc50

unread,
Aug 19, 2015, 11:02:45 AM8/19/15
to Tethys Platform
Hey Noah,

I was able to talk to Nathan and it turns out that I was mistaken about how collect static works in production. The app static folders are still symbolically linked in production so you should be able to dump files there and be able to reference them through the global static url: example.com/static/app-name/path/to/your/folder. If I understand correctly it should work the same way in a development environment as in production.

Good luck!

Nathan Swain

unread,
Aug 19, 2015, 1:18:27 PM8/19/15
to Tethys Platform, sdc50
That is correct, with one clarification: you must use the Tethys CLI
collectstatic command to have the directories symbolically linked. The
linking behavior is not a feature of the Django collectstatic command. Here
is the Tethys version:

$ tethys manage collectstatic



--
You received this message because you are subscribed to the Google Groups "Tethys Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tethysplatfor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tethysplatform/98800d16-6726-429b-81c5-103c541cd29b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Nathan Swain
Reply all
Reply to author
Forward
0 new messages