Переход к http://127.0.0.1:8300/projects/cprshelp/edit_file/?filename=manage.py приводит к ошибке 404
urls.py
(r'^projects/(?P<project_name>[\w ,-<>]+)/', include('projects.urls')),
projects / urls.py
(r'edit_file/$', views.edit_file),
Что делатьМне нужно перейти на мои файлы URL, чтобы этот конкретный URL работал?
Список допустимых URL:
^admin/doc/
^admin/
^projects/(?P<project_name>[\w ,-<>]+)/ edit_file/$
^media/(?P<path>.*)$
Функция edit_file:
def edit_file(request, project_name):
print '**** project name ' + project_name
#project = Project.objects.get(name=project_name)
filename = request.GET['filename']
#content_of_file = open(project.file_location + filename, 'r')
#content_of_file = '\n'.join(content_of_file.readlines())
context = RequestContext(request, {
#"project": project,
#"files": get_files_and_directories(project.file_location),
"filename": filename,
#"content_of_file": content_of_file,
})
return render_to_response("edit_file.html", context)