Good evening
I'm trying to create a view in Django and doing the runserver gives me the following error:
Performing system checks ...
Unhandled exception in thread started by Traceback (most recent call last): File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ utils \ autoreload.py", line 226, in wrapper fn (* args, ** kwargs) File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ core \ management \ commands \ runserver.py", line 121, in inner_run self.check (display_num_errors = True) File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ core \ management \ base.py", line 374, in check include_deployment_checks = include_deployment_checks, File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ core \ management \ base.py", line 361, in _run_checks return checks.run_checks (** kwargs) File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ core \ checks \ registry.py", line 81, in run_checks new_errors = check (app_configs = app_configs) File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ core \ checks \ urls.py", line 14, in check_url_config return check_resolve (resolve) File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ core \ checks \ urls.py", line 24, in check_resolver for pattern in resolver.url_patterns: File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ utils \ functional.py", line 35, in get res = instance. dict [self.name] = self.func (instance) File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ urls \ resolvers.py ", line 313, in url_patterns patterns = getattr (self.urlconf_module, "urlpatterns", self.urlconf_module) File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ utils \ functional.py", line 35, in get res = instance. dict [self.name] = self.func (instance) File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ urls \ resolvers.py ", line 306, in urlconf_module return import_module (self.urlconf_name) File "C: \ Python27 \ lib \ importlib__init __. py", line 37, in import_module import (name) File "C: \ Users \ Manux \ Desktop \ probardjango \ src \ pdj \ urls.py", line 21, in url (r '', 'boletin.views.incio', name = 'home'), File "C: \ Python27 \ lib \ site-packages \ django-1.10.6-py2.7.egg \ django \ conf \ urls__init__.py ", line 85, in url raise TypeError ('view must be a callable or a list / tuple in the case of include ().') TypeError: view must be a callable or a list / tuple in the case of include ().
'views.py':
from django.shortcuts import render
# Create your views here.
def inicio(request):
return render(request, "inicio.html", {})
'urls.py':
from django.conf.urls import url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', 'boletin.views.incio', name='inicio'),
]
'settings.py':
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'boletin',
]
ROOT_URLCONF = 'pdj.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, "templates")],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
I hope you can help me, thanks in advance and greetings.