2

I have a problem with django template. I made new template file in pycharm and in code i think all is good. But i have errno 13 permission denied. Other templates are working fine.

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/Doggo/2/results/

Django Version: 1.11
Python Version: 3.6.1
Installed Applications:
['Doggo.apps.DoggoConfig',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback:

File "C:\Python36-32\lib\site-packages\django\core\handlers\exception.py" in inner
  41.             response = get_response(request)

File "C:\Python36-32\lib\site-packages\django\core\handlers\base.py" in _get_response
  217.                 response = self.process_exception_by_middleware(e, request)

File "C:\Python36-32\lib\site-packages\django\core\handlers\base.py" in _get_response
  215.                 response = response.render()

File "C:\Python36-32\lib\site-packages\django\template\response.py" in render
  107.             self.content = self.rendered_content

File "C:\Python36-32\lib\site-packages\django\template\response.py" in rendered_content
  82.         template = self.resolve_template(self.template_name)

File "C:\Python36-32\lib\site-packages\django\template\response.py" in resolve_template
  64.             return select_template(template, using=self.using)

File "C:\Python36-32\lib\site-packages\django\template\loader.py" in select_template
  48.                 return engine.get_template(template_name)

File "C:\Python36-32\lib\site-packages\django\template\backends\django.py" in get_template
  39.             return Template(self.engine.get_template(template_name), self)

File "C:\Python36-32\lib\site-packages\django\template\engine.py" in get_template
  162.         template, origin = self.find_template(template_name)

File "C:\Python36-32\lib\site-packages\django\template\engine.py" in find_template
  136.                         name, template_dirs=dirs, skip=skip,

File "C:\Python36-32\lib\site-packages\django\template\loaders\base.py" in get_template
  38.                 contents = self.get_contents(origin)

File "C:\Python36-32\lib\site-packages\django\template\loaders\filesystem.py" in get_contents
  28.             with io.open(origin.name, encoding=self.engine.file_charset) as fp:

Exception Type: PermissionError at /Doggo/2/results/
Exception Value: [Errno 13] Permission denied: 'C:\\Users\\noob1_000\\PycharmProjects\\eWybory\\Doggo\\templates'

i think i have permission to this folder because other templates are working. I'm working on windows 10

Mestowaty
  • 165
  • 1
  • 1
  • 8
  • so go and give permission to the templates folder, i guess pycharm is not giving proper permission to the file created from pycharm – Exprator May 22 '17 at 16:55

2 Answers2

0

I would recommend to go through this-

Also , the view that you uses the template are also in the same directory as other views since you said that other views are able to access their templates ?

Let me know , if this solves your problem

tom
  • 3,720
  • 5
  • 26
  • 48
  • it can be possible that you might copy paste your template file resulting in different permissions apart from other files ? compare again the template file permssions and make if any changes needed. – tom May 22 '17 at 17:03
0

Maybe you are just forgetting to indicate the template path (template / app/index.html) in the views.py.

Nikaido
  • 4,443
  • 5
  • 30
  • 47
eflipe
  • 11
  • 1