In my django application structure is as follows:
__init__.py
__init__.pyc
models.py
tests.py
usage.rrd
views.py
views.pyc
I am trying to access the usage.rrd
file in views.py
as follows:
from django.http import HttpResponse
import rrdtool
def hello(request):
info = rrdtool.info('usage.rrd')
return HttpResponse(info)
but I am getting:
opening '/usage.rrd': No such file or directory
despite being in the current directory.
The application starts from the root directory of your project. So you you need to fix your path, ('app-name/usage.rrd') .