0

I have developped an app called textModif. I am extending it now to include registration features. To that purpose, I use django-registration module.

I can reach 127.0.0.1:8000/textModif/accounts/register/ without problem. However, when I click on submit, I have an error:

Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order:
^admin/doc/
^admin/
^textModif/
The current URL, accounts/register/, didn't match any of these.

The URL 127.0.0.1:8000/accounts/register/ indeed does not exist it should be 127.0.0.1:8000/textModif/accounts/register. I have not managed to solve this issue, any help would therefore be appreciated. Here is the urls.py in my textModif module:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

from django.conf.urls import patterns, url
from django.conf.urls.defaults import *
from textModif import views
from django.contrib.auth.views import login, logout, password_change, password_change_done, password_reset, password_reset_done, password_reset_confirm, password_reset_complete


# name = indique la référence qu'on va utiliser dans le template {% url qqch%}

urlpatterns = patterns('',
    url(r'^(index)?$', views.index, name='index'),
    url(r'^demo$', views.demo, name='demo'),

    url(r'^login?$', login, name='login'),
    url(r'^logout$', logout, name='logout'),
    url(r'^password_change$', password_change, name='password_change'),
    url(r'^password_change/done$', password_change_done, name='password_change_done'),
    url(r'^password_reset$', password_reset, name='password_reset'),
    url(r'^password_reset/done$', password_reset_done, name='password_reset_done'),
    url(r'^reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        password_reset_confirm,
        name='password_reset_confirm'),
    url(r'^reset/done/$', password_reset_complete, name='password_reset_complete'),         
    url(r'^processLogin$', views.processLogin, name='processLogin'),

    url(r'^accounts/', include('registration.urls')),
    #url(r'^processSubscr$', views.processSubscr, name='processSubscr'),
    url(r'^subscribe$', views.subscribe, name='subscribe'),

    url(r'^process$', views.process, name='process'),    
    url(r'^thanks$', views.thanks, name='thanks'),
    url(r'^contact$', views.contact, name='contact'),
    url(r'^blog$', views.index, name='blog'),
    url(r'^send$', views.send, name='send'),
    url(r'^faq$', views.faq, name='faq'),
    # ex: http://127.0.0.1:8000/textModif/1/
    url(r'^(?P<textTask_id>\d+)/$', views.detail, name='detail'),
    #url(r'^static/(?P<path>.*)$', 'django.views.static.serve',
    #{'document_root': '/home/gbertran/virtualenv_1/djangoProj_1/mysite/textModif/static'})
)

#from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# ... the rest of your URLconf here ...
#urlpatterns += staticfiles_urlpatterns()

Thanks!

  • Ok I was not looking in the right direction. The problem is not in urls.py, it's in my template ! The template registration/registration_form.html sent the user inputs to the wrong url. I have corrected this behavior and I think it will work (I have another bug for the moment) – user1821466 Nov 21 '12 at 12:23
  • So... it is not a real question anymore, right? Can you close/delete it yourself? – Reinout van Rees Nov 21 '12 at 12:48
  • Good, btw, that you included the urls.py and enough information. In that sense it was a good question! – Reinout van Rees Nov 21 '12 at 12:49
  • Yep, that was it. Problem solved ! now my registration form looks like this :

    Register

    {% csrf_token %} {{ form.as_table }}

    – user1821466 Nov 21 '12 at 12:49

1 Answers1

0

The answer was to correct the template, as indicated in the comments.