Issue
I'm getting the project path in my Django app in settings.py using:
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
I would like to use the PROJECT_PATH value in other views, such as for locating the path to files in my static path. How can I make this into an accessible variable?
Solution
Use from django.conf import settings
but mind that settings
is not a module. The documentation clearly explains that and your use case.
Answered By - AndiDog
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.