django-1.10

django 1.10 media images don't show

你离开我真会死。 提交于 2019-12-04 12:55:30
I have had django media images working in an existing django 1.7 project by adding the following to site urls.py: urlpatterns = patters( url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), ) This url structure doesn't work in django 1.10 and so I changed it to the reccommended here Django MEDIA_URL and MEDIA_ROOT : urlpatterns = [ ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) This fails to render any uploaded media images. Is there an equivalent media url patter for django 1.10 I can use? You can use this:

The current URL, app/, didn't match any of these

自闭症网瘾萝莉.ら 提交于 2019-11-29 14:05:26
I'm a newbie in Django and just started looking at it before a day by installing Django 1.10 on my local. I've followed all the instructions of this link https://docs.djangoproject.com/en/dev/intro/tutorial01/ . However I'm continuously getting this error: Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/polls/ Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^admin/ The current URL, polls/, didn't match any of these. I've created polls app to getting started. To make a start, I went with view.py, here is the code: polls/views

The current URL, app/, didn't match any of these

别说谁变了你拦得住时间么 提交于 2019-11-28 03:25:37
问题 I'm a newbie in Django and just started looking at it before a day by installing Django 1.10 on my local. I've followed all the instructions of this link https://docs.djangoproject.com/en/dev/intro/tutorial01/. However I'm continuously getting this error: Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/polls/ Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^admin/ The current URL, polls/, didn't match any of these. I've

Django URLs TypeError: view must be a callable or a list/tuple in the case of include()

半城伤御伤魂 提交于 2019-11-26 00:24:01
问题 After upgrading to Django 1.10, I get the error: TypeError: view must be a callable or a list/tuple in the case of include(). My urls.py is as follows: from django.conf.urls import include, url urlpatterns = [ url(r\'^$\', \'myapp.views.home\'), url(r\'^contact/$\', \'myapp.views.contact\'), url(r\'^login/$\', \'django.contrib.auth.views.login\'), ] The full traceback is: Traceback (most recent call last): File \"/Users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/utils