SHARE
TWEET

Untitled

a guest Oct 4th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Performing system checks...
  2.  
  3. Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10fc44510>
  4. Traceback (most recent call last):
  5.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/utils/autoreload.py", line 228, in wrapper
  6.     fn(*args, **kwargs)
  7.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run
  8.     self.check(display_num_errors=True)
  9.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/core/management/base.py", line 359, in check
  10.     include_deployment_checks=include_deployment_checks,
  11.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/core/management/base.py", line 346, in _run_checks
  12.     return checks.run_checks(**kwargs)
  13.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/core/checks/registry.py", line 81, in run_checks
  14.     new_errors = check(app_configs=app_configs)
  15.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/core/checks/urls.py", line 16, in check_url_config
  16.     return check_resolver(resolver)
  17.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/core/checks/urls.py", line 26, in check_resolver
  18.     return check_method()
  19.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/urls/resolvers.py", line 254, in check
  20.     for pattern in self.url_patterns:
  21.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/utils/functional.py", line 35, in __get__
  22.     res = instance.__dict__[self.name] = self.func(instance)
  23.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/urls/resolvers.py", line 405, in url_patterns
  24.     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  25.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/utils/functional.py", line 35, in __get__
  26.     res = instance.__dict__[self.name] = self.func(instance)
  27.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
  28.     return import_module(self.urlconf_name)
  29.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/importlib/__init__.py", line 126, in import_module
  30.     return _bootstrap._gcd_import(name[level:], package, level)
  31.   File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  32.   File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  33.   File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  34.   File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  35.   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  36.   File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  37.   File "/Users/dmuino/.virtualenvs/Pruebas/CursoProDjango/eventus/eventus/urls.py", line 23, in <module>
  38.     url(r'^', include('myapps.users.urls', namespace="users_app")),
  39.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/conf/urls/__init__.py", line 50, in include
  40.     urlconf_module = import_module(urlconf_module)
  41.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/importlib/__init__.py", line 126, in import_module
  42.     return _bootstrap._gcd_import(name[level:], package, level)
  43.   File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  44.   File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  45.   File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  46.   File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  47.   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  48.   File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  49.   File "/Users/dmuino/.virtualenvs/Pruebas/CursoProDjango/eventus/myapps/users/urls.py", line 5, in <module>
  50.     url(r'^login/$', 'myapps.users.views.userlogin', name="login"),
  51.   File "/Users/dmuino/.virtualenvs/Pruebas/lib/python3.6/site-packages/django/conf/urls/__init__.py", line 85, in url
  52.     raise TypeError('view must be a callable or a list/tuple in the case of include().')
  53. TypeError: view must be a callable or a list/tuple in the case of include().
  54.    
  55. from django.conf.urls import  url, include
  56. from django.contrib import admin
  57. from django.conf import settings
  58. from django.conf.urls.static import static
  59.  
  60. urlpatterns = [
  61.     url(r'^', include('myapps.events.urls', namespace="events_app")),
  62.     url(r'', include('myapps.users.urls', namespace="users_app")),
  63.     url(r'^admin/', admin.site.urls),
  64. ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  65.    
  66. from django.conf.urls import  url, include
  67.  
  68.  
  69. urlpatterns = [
  70.     url(r'^login/$', 'myapps.users.views.userlogin', name="login"),
  71.     url(r'^salir/$', 'apps.users.views.LogOut', name = 'logout'),
  72.     ]
  73.    
  74. from django.shortcuts import render
  75. from django.contrib.auth import login, authenticate, logout
  76. from .forms import UserRegisterForm
  77. from .models import User
  78. # Create your views here.
  79.  
  80. def userlogin(request):
  81.     if request.method == "POST":
  82.         if 'register_form' in request.POST:
  83.             user_register = UserRegisterForm(request.POST)
  84.             if user_register.is_valid():
  85.                 User.objects.create_user(
  86.                     username = user_register.cleaned_data['username'],
  87.                     email = user_register.cleaned_data['email'],
  88.                     password = user_register.cleaned_data['password'])
  89.                 return redirect('/')
  90.         if 'login_form' in request.POST:
  91.             login_form = LoginForm(request.POST)
  92.             if login_form.is_valid():
  93.                 user = authenticate(username = login_form.cleaned_data['username'],
  94.                     password = login_form.cleaned_data['password'])
  95.                 if user is not None:
  96.                     if user.is_active:
  97.                         login(request, user)
  98.                         return redirect('/')
  99.  
  100.     else:
  101.         user_register = UserRegisterForm()
  102.         login_form = LoginForm()
  103.     return render(request, 'users/login.html',
  104.         {'user_register' : user_register,
  105.         'login_form' : login_form
  106.  
  107.         })
  108.  
  109. def LogOut(request):
  110.     logout(request)
  111.     return redirect('/')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top