Solucionado (ver solução)
Solucionado
(ver solução)
3
respostas

Erro ao rodar a pagina de registrar

Erro ao rodar

ImproperlyConfigured at / The included urlconf '<module 'usuario.urls' from '/home/sandroni/django/socialconnect/usuario/urls.py'>' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import. Request Method: GET Request URL: http://localhost:8000/ Django Version: 1.7.4 Exception Type: ImproperlyConfigured Exception Value:The included urlconf '<module 'usuario.urls' from '/home/sandroni/django/socialconnect/usuario/urls.py'>' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import. Exception Location: /usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py in url_patterns, line 381 Python Executable: /usr/bin/python Python Version: 2.7.15 Python Path:['/home/sandroni/django/socialconnect', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/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', '/usr/lib/python2.7/dist-packages/gtk-2.0'] Server time: Wed, 29 Aug 2018 00:16:57 +0000

Abaixo o código que informar estar o problema

from django.conf.urls import patterns, url from usuario.views import RegistraUsuario

urlsPattern = patterns('', url(r'^registrar/$',RegistraUsuario.as_view(),name='registrar') )

3 respostas

Júlio,

Faltou uma virgula no final do arquivo url.py

Como deve ficar o arquivo

# connectedin/usuarios/urls.py 

from django.conf.urls import patterns, url
from usuarios.views import RegistrarUsuarioView

urlpatterns = patterns('',
    url(r'^registrar/$',  RegistrarUsuarioView.as_view(), name='registrar'),)

Como vc digitou:

# connectedin/usuarios/urls.py 

from django.conf.urls import patterns, url from usuario.views import RegistraUsuario

urlsPattern = patterns('', 
  url(r'^registrar/$',RegistraUsuario.as_view(),name='registrar') )

OBS: No final da ultima linha tem dois parenteses tem uma vírgula entre eles.

solução!
from django.conf.urls import patterns, url
from usuarios.views import RegistrarUsuarioView

urlpatterns = patterns('',
    url(r'^registrar/$',  RegistrarUsuarioView.as_view(), name='registrar'),
)

Na minha opinião , o erro está no urlspatterns = patterns onde vc digitou urlpattern, sem aletra s no final ou seja é no plural urlspatterns.

Julio,

O Luis tem razão são a falta da virgula não faz diferença, agora o erro do urlpatern sem o "s" causa o erro que vc observou!