2013-10-08 3 views
0

등록이라는 장고 앱을 설치했습니다. 나는 템플리트를 설정하고, URL에 추가하고 파일을 보았고, 모든 것은 훌륭하게 작동했다. 이제는 로그 아웃 후 시스템에 로그인하는 데 문제가 있습니다. 쿠키는 브라우저에서 쿠키를 지우고 (여러 번 시도해 보았습니다.)/등록/로그인해야합니다./"정보를 입력하면 로그인 할 수 있습니다. 내 로그 아웃 버튼을 클릭하면 모든 것이 정상적으로 기록됩니다. 지금은 일반적으로 이러한 오류가에 이름을 줄 것이다Django NoReverseMatch 등록 App

NoReverseMatch at /registration/login/ 
Reverse for '' with arguments '()' and keyword arguments '{}' not found. 
Request Method: POST 
Request URL: http://genie:8181/registration/login/ 
Django Version: 1.5.2 
Exception Type: NoReverseMatch 
Exception Value:  
Reverse for '' with arguments '()' and keyword arguments '{}' not found. 
Exception Location: /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py  in _reverse_with_prefix, line 416 
Python Executable: /usr/bin/python 
Python Version: 2.7.3 
Python Path:  
['/var/www/RegCal', 
'/usr/local/lib/python2.7/dist-packages/South-0.8.2-py2.7.egg', 
'/usr/local/lib/python2.7/dist-packages/distribute-0.7.3-py2.7.egg', 
'/usr/local/lib/python2.7/dist-packages/setuptools-1.1.6-py2.7.egg', 
'/usr/lib/python2.7', 
'/usr/lib/python2.7/plat-linux2', 
'/usr/lib/python2.7/lib-tk', 
'/usr/lib/python2.7/lib-old', 
'/usr/lib/python2.7/lib-dynload', 
'/usr/local/lib/python2.7/dist-packages', 
'/usr/lib/python2.7/dist-packages'] 
Server time: Tue, 8 Oct 2013 17:18:11 -0500 
Traceback Switch to copy-and-paste view 

/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py in get_response 
        response = callback(request, *callback_args, **callback_kwargs) ... 
▶ Local vars 
/usr/local/lib/python2.7/dist-packages/django/views/decorators/debug.py in  sensitive_post_parameters_wrapper 
      return view(request, *args, **kwargs) ... 

를 얻을 내가 "/ 등록/로그인 /"와 양식에 내 정보를 입력하고 제출로 이동 두 번째 로그인을 갈 때 문제는 "행 번호 및 URL 문제와 함께"함께 "역순으로 사용하십시오. 내가 왜이 URL에 액세스 할 수 있는지 이해하지 못하는 이유는 양식이 게시되지 않기 때문입니다. 어떤 팁이나 힌트를 미리 주셔서 감사 드리며 귀하가보고 싶은 것이 있으면 알려 주시면 업로드하겠습니다. 로그인 에 대한

템플릿 파일이

{% block title %} | Please login{% endblock title %} 

{% block content %} 
    {% if forms.errors %} 
     <p>Sorry, that's not a valid username or password</p> 
    {% endif %} 
    <div class="row-fluid"> 
     <form id="login_small" class="span6" action="{{ app_path }}" method="post" >{% csrf_token %} 
      <div class="span4 pic"></div> 

      <div class="span8"> 
       <span></span> 
       <input type="text" name="username" value="Username" id="username"> 
       <input type="password" name="password" value="password" id="password"> 
       <input type="submit" value="login" class="submit_but" /> 
      </div> 
     </form> 
    </div> 

{% endblock content %} 

내가 변화 시도 그냥 메모 {%가 'base.html'% 확장} {{APP_PATH가}}하지만 아무것도 변경하지 않은 난 아직도있어 같은 오류

URL 패턴 파일 :

from django.conf.urls import patterns, include, url 

# Uncomment the next two lines to enable the admin: 
from django.contrib import admin 
admin.autodiscover() 

urlpatterns = patterns('', 
    #Get urls from the userprofile app 
    url(r'^account/', include('userprofile.urls')), 

    #URL Patterns for the registration apps 
    url(r'^registration/', include('registration.backends.default.urls')), 

    #Site Admin URL Patterns 
    url(r'^admin/', include(admin.site.urls)), 
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')), 

    #Day URL Patterns 
    url(r'^view/day/(\d+)/(\d+)/(\d+)/$', 'courseCalendar.views.day'), 
    url(r'^view/day$', 'courseCalendar.views.day'), 

    #Month URL Patterns 
    url(r'^view/month$', 'courseCalendar.views.month'), 
    url(r'^view/month/(?P<year>\d{4})/(?P<month>\d{1,2})$', 'courseCalendar.views.month'), 
    url(r'^view/month/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<change>\w+)$', 'courseCalendar.views.month'), 

    #Year URL Patterns 
    url(r"^view/year/(?P<year>\d+)$", 'courseCalendar.views.year'), 

    #Course Edit Patterns 
    url(r"^edit/course/(?P<courseID>\d+)$", 'courseCalendar.views.courseEdit'), 
    url(r"^edit/course$", 'courseCalendar.views.courseEdit'), 

    #Enroll Student Page 
    url(r"^enroll/(?P<courseID>\d+)/(?P<userID>\d+)$", 'courseCalendar.views.enroll'), 

    #Search through existing courses 
    url(r"^search/$", 'courseCalendar.views.courseSearch'), 

    #Root Directory Pattern 
    url(r'', 'courseCalendar.views.year'), 
) 
+0

그럼 빈 문자열을 뒤집어 쓰려고하는 것 같습니다. 템플릿을 게시하십시오. –

+0

app_path에서 "/ registration/login /"로 변경하려고 시도했지만 변경되지 않았습니다. – Cody

+1

URL을 추가 할 수 있습니까? .py? – yuvi

답변

0

이 잘 나는이 정말 바보 같은 생각합니다. 이 오류가 발생하는 이유는 LOGIN_REDIRECT_URL = ''이 (가) 있기 때문입니다. 그게 문제가 URL의 다음 매개 변수에 다른 인수를 입력하여 내가 로그인 할 수 있다고 생각했다. 처음에는 그것이 루트 디렉토리에 대한 요청을 잡기 내 URL 파일을 생각하지만 그건 이해가되지 않았다. 루트 URL을 치고 페이지를 제공 할 수 있습니다. 나는 설정 페이지를 살펴보기로 결정했고, 그 라인을 변경하고 그것을 바꿨고 정상으로 돌아왔다.

관련 문제