Default static directory vs. justpy.env file location
See original GitHub issueAccording to the docs, the justpy.env file should be in the directory from which the program is run. The default static directory however is the same folder:
STATIC_DIRECTORY = config('STATIC_DIRECTORY', cast=str, default=os.getcwd())
This means, by the default, the justpy.env (possibly containing sensitive information) can be reached at http://localhost:8000/static/justpy.env
Isn’t this a security flaw? Might be better to change the default to the module directory as with the templates:
STATIC_DIRECTORY = config('STATIC_DIRECTORY', cast=str, default=f'current_dir + '/static')
And include the default JustPy favicon there as well? So the favicon also works in the NO_INTERNET scenario.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Configuration Variables - JustPy
The file needs to be located in the directory from which the program is run. ... config = Config('justpy.env') # Determines if error...
Read more >justpy app don't work on AWS Lightsail; no error but also no ...
A justpy.env file with this parameters: HOST = '0.0.0.0' PORT = 8000. A Lightsail Ubuntu VM with static URL runs the file with...
Read more >justpy/justpy.py at master · justpy-org/justpy - GitHub
An object oriented high-level Python Web Framework that requires no frontend programming - justpy/justpy.py at master · justpy-org/justpy.
Read more >How to setup static files in Django - PythonAnywhere help
The STATIC_ROOT variable in settings.py defines the single folder you want to ... you can change the default STATIC_URL, which is /static/ ,...
Read more >Configure Static Files Path on a Development Server - YouTube
In this Django Python tutorial we learn to configure the static folder so that we can server files such as CSS, JS or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the feedback. Even with a solution in place, might be useful to mention in the docs not to use the working dir as a static folder…
move papillon.jpg when explaining the move of static content