question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default static directory vs. justpy.env file location

See original GitHub issue

According 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:open
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
platinopscommented, Oct 29, 2020

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…

0reactions
WolfgangFahlcommented, Nov 5, 2022

move papillon.jpg when explaining the move of static content

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found