Use the following in urls.py:
from django.conf.urls import include,url
On Sat, Aug 25, 2018 at 12:54 PM Aware Fun <rahulsharma82630@gmail.com> wrote:
--rahulOn Fri, Aug 24, 2018, 3:17 AM herve kabore <kaboreherve1@gmail.com> wrote:--this is the urls.pyfrom django.conf.urls import include,urlfrom django.contrib import adminurlpatterns = [url(r'^admin/', include(admin.site.urls)),url(r'^$', 'blog.views.home', name='home'),]this is the viewsfrom django.shortcuts import renderfrom django.http import HttpResponse# Create your views here.def home(request):return HttpResponse("Bonjour monde!")Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f8f4a8afe18>Traceback (most recent call last):File "/usr/lib/python3/dist-packages/django/utils/autoreload.py", line 228, in wrapperfn(*args, **kwargs)File "/usr/lib/python3/dist-packages/django/core/management/commands/runserver.py", line 124, in inner_runself.check(display_num_errors=True)File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 359, in checkinclude_deployment_checks=include_deployment_checks,File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 346, in _run_checksreturn checks.run_checks(**kwargs)File "/usr/lib/python3/dist-packages/django/core/checks/registry.py", line 81, in run_checksnew_errors = check(app_configs=app_configs)File "/usr/lib/python3/dist-packages/django/core/checks/urls.py", line 16, in check_url_configreturn check_resolver(resolver)File "/usr/lib/python3/dist-packages/django/core/checks/urls.py", line 26, in check_resolverreturn check_method()File "/usr/lib/python3/dist-packages/django/urls/resolvers.py", line 256, in checkfor pattern in self.url_patterns:File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 35, in __get__res = instance.__dict__[self.name] = self.func(instance)File "/usr/lib/python3/dist-packages/django/urls/resolvers.py", line 407, in url_patternspatterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)File "/usr/lib/python3/dist-packages/django/utils/functional.py", line 35, in __get__res = instance.__dict__[self.name] = self.func(instance)File "/usr/lib/python3/dist-packages/django/urls/resolvers.py", line 400, in urlconf_modulereturn import_module(self.urlconf_name)File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_modulereturn _bootstrap._gcd_import(name[level:], package, level)File "<frozen importlib._bootstrap>", line 994, in _gcd_importFile "<frozen importlib._bootstrap>", line 971, in _find_and_loadFile "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlockedFile "<frozen importlib._bootstrap>", line 665, in _load_unlockedFile "<frozen importlib._bootstrap_external>", line 678, in exec_moduleFile "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removedFile "/home/herve/Bureau/mes_projets/eboutique/eboutique/urls.py", line 20, in <module>url(r'^$', 'backoffice.views.home', name='home'),File "/usr/lib/python3/dist-packages/django/conf/urls/__init__.py", line 85, in urlraise 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().
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c20e08d2-2578-4430-963e-bb14df3a0ece%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2B8bEuQ%2BuF7YM7S9q-DSPD9QCOgeXrLKp_5M_XNEEJp_JKQG%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHMQ533qkz7W4rt_A3kAegOXS8JSLYL9LwD-wPZ9paznyNg%3DdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment