Request Method: | GET |
---|---|
Request URL: | http://localhost:8000/polls/ |
Using the URLconf defined in mysite.urls
, Django tried these URL patterns, in
this order:
The current URL, polls/
, didn't match any of
these.
It doesn't appear that you've included your apps urls.py correctly using an include() in your project urls.py.
Can you post both of your urls.py files?
-James
Starting development server at http://127.0.0.1:8000/Quit the server with CTRL-BREAK.
Note
Ignore the warning about unapplied database migrations for now; we’ll deal with the database shortly.
Here is a link to the tutorial: https://docs.djangoproject.com/en/1.9/intro/tutorial01/
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls.apps.PollsConfig',
]
--
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...@googlegroups.com.
To post to this group, send email to django...@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/c14e04f8-be34-4569-ae42-48e8d4135a2c%40googlegroups.com.
# Your first view: opprettet polls/urls.py from django.conf.urls import url from . import views urlpatterns = [ url(r'ˆ$', views.index, name='index'), ] # Your first view polls/views.py from django.http import HttpResponse def index(request): return HttpResponse("Hoppla, polls index her..") # Site/urls.py from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'ˆpolls/', include('polls.urls')), url(r'^admin/', admin.site.urls), ] # Site/settings.py # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'polls.apps.PollsConfig',
Hi,
On Tuesday 07 March 2017 01:24:02 Vanja Falck wrote:
> urlpatterns = [
> url(r'ˆpolls/', include('polls.urls')),
> url(r'^admin/', admin.site.urls),
> ]
Easy to see this way. You didn't type a caret but some unicode sign that looks like a caret.
--
Melvyn Sopacua
--
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...@googlegroups.com.
To post to this group, send email to django...@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/2571142.lux90pYzcz%40devstation.
You may have a strange, non-visible character in your file just before the line giving error.
Why is there a backslash in
from django.conf.urls import polls\
?
On 3/16/17, Camilo Torres <camilo...@gmail.com> wrote:
> Hi.
>
> You may have a strange, non-visible character in your file just before the
> line giving error.
>
> --
> 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...@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/f9e098eb-2362-4cc1-bc41-0b5a03f64172%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/aZQoPBeHDPs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@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/CALn3ei2hsX-YPbrf-47E5vfyR-So88UVGHGWGt06br1Jaiqf%3DA%40mail.gmail.com.
I am facing trouble while running the tutorial for Django. I have attached the error details and the complete code. I am using python 3.x, django 2.0.x with anaconda distribution on python. Please help me asap.
Thanks in advance!
Regards,
Kamal Kumar Bharadwaj
I'm not sure why, but it stopped the error and send to import it. I'm using 3.6?
On Mar 16, 2017 11:45 AM, "Vijay Khemlani" <vkhe...@gmail.com> wrote:
Why is there a backslash in
from django.conf.urls import polls\
?
On 3/16/17, Camilo Torres <camilo...@gmail.com> wrote:
> Hi.
>
> You may have a strange, non-visible character in your file just before the
> line giving error.
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django...@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/f9e098eb-2362-4cc1-bc41-0b5a03f64172%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/aZQoPBeHDPs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/de3b1465-be3b-4144-9bf3-62543a3a91fc%40googlegroups.com.
--
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...@googlegroups.com.
To post to this group, send email to django...@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/778da3c3-92a0-4560-b2e2-7b7d5539ad85%40googlegroups.com.
I have been testing this tutorial frequently over the last few days (with success) and am using an empty string ( ‘’ ) for the route (first argument to path) in the app’s urls.py, rather than the ‘raw’ string value I see in the earlier posts here.
--
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...@googlegroups.com.
To post to this group, send email to django...@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/af3851c0-3442-479e-9f97-e3e7b8f883a4%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/aZQoPBeHDPs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/61ca2cd8-70cb-4a5b-8ae7-5657ef413209%40googlegroups.com.