2014-10-07 3 views
2

에서 NoReverseMatch 나는 두 장고 프로젝트를 동기화하려고 다음과 같은 오류와 함께 자신을 발견하고 있습니다 :장고 -

5 
6 
7 {% block content %} 
8 
9 {% if form.non_field_errors %} 
10 <div class="panel"> 
11 {{ form.non_field_errors }} 
12 </div> 
13 {% endif %} 
14 
15 <form action="{% url 'file-add' %}" method="post" enctype="multipart/form-data"> 
16 <fieldset> 
17  <legend>Add CV</legend> 
18 
19  <div class="large-12 columns"> 
20  <div class="row" id="file_container"> 
21   {% if form.f.errors %} 
22   <input placeholder="First name" name="f" type="file" id="file" class="error" /> 
23   {% else %} 
24   <label for="f" name="CV" /> 
25   <input name="f" type="file" id="file" /> 
:

Reverse for 'file-add' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []

템플릿, 라인 (15)과 함께 지금 문제가있는 것 같습니다

어떤 식 으로든이 템플릿을 변경하는 것을 기억하지 못하고 모든 파일이 다른 서버의 템플릿과 동일해야하므로 작은 문제가 있습니까?

> <form action="{% url 'file-add' %}" method="post" enctype="multipart/form-data"> 

편집

내 URL을 파일을 함께 할 수있는 뭔가 것 같다. 나는 url "/ jobs /"로 무엇이든지 작업 URL 파일에 전달하는 메인 URL 파일을 가지고있다.

url(r'^jobs/', include('jobs.urls', namespace="jobs")), 
url(r'^admin/', include(admin.site.urls)), 
url(r'^admin_tools/', include('admin_tools.urls')), 

작업 URL 파일은 관련 작업 페이지를 가리 킵니다. 내가 메인 URL을 파일로 "파일 추가"라인을 이동하는 경우, 그것은 작동하는 것 같다

url(r'^new', views.importDemoData, name='importDemoData'), 
url(r'^add', FileAddView.as_view(), name='file-add'), 
url(r'^files/list', FileListView.as_view(), name='list'), 

# This view lists uploaded files 
url(r'^success', FileListView.as_view(), name='home'), 
url(r'^(?P<unique_id>\w+)/$', views.application, name='application'), 

... 누군가가 나에게 이것을 설명 할 수 있다면

답변

0

당신은 URL 이름 앞에 네임 스페이스를 추가하는 것을 잊었다

"작업/추가"의 역 분개는 {% url 'jobs : {% url'namespace : name '%} 인 파일 추가'%}입니다.

당신은 때문에 근무 네임 스페이스를 제거 할 때 {%의 URL을 '파일 추가'%}

0

이 좋은 것입니다 ..

,517 :로 변경

url(r'^jobs/', include('jobs.urls', namespace="jobs")), 

:

내가 메인 URL을 파일에이 줄에서 네임 스페이스를 제거

그리고 효과가있었습니다. 내 다른 서버에 그렇게 잘 작동 것 같다 이것은

0

들이 자신의 문서에서 말하는 것처럼 .. 조금 이상한 : url-namespaces-and-included-urlconfs

URL namespaces of included URLconfs can be specified in two ways.

Firstly, you can provide the application and instance namespaces as arguments to include() when you construct your URL patterns. For example,:

url(r'^polls/', include('polls.urls', namespace='author-polls', app_name='polls')),

This will include the URLs defined in polls.urls into the application namespace 'polls', with the instance namespace 'author-polls'.

Secondly, you can include an object that contains embedded namespace data. If you include() a list of url() instances, the URLs contained in that object will be added to the global namespace. However, you can also include() a 3-tuple containing:

(<list of url() instances>, <application namespace>, <instance namespace>)

1

과 일치합니다 '작업/추가'URL 난 당신이 URL 이름의 네임 스페이스 앞을 추가해야한다고 생각