2017-05-22 67 views
0

我有一個django模板的問題。我在pycharm中創建了新的模板文件,並且在代碼中我認爲一切都很好。但我有errno 13權限被拒絕。其他模板工作正常。django模板errno 13

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' 

我想我有這個文件夾的權限,因爲其他模板正在工作。 我工作在Windows 10

+0

這樣下去,給權限的模板文件夾,我想pycharm是不會放棄從pycharm創建的文件 – Exprator

回答

0

我會建議要經過this -

而且,你使用模板的觀點也都在同一目錄中其他的觀點,因爲你說,其他的意見都能夠訪問他們的模板?

讓我知道,如果這能解決你的問題

+0

其他視圖都在同一目錄適當的權限.. 。 – Mestowaty

+0

您可能會複製粘貼您的模板文件,導致與其他文件不同的權限?再次比較模板文件permssions,並做出是否需要更改。 – tom

相關問題