вот что у меня есть:
1.C:\django\opentodo
2.C:\xampp\htdocs\opentodo_media
привоожу часть settings.py:
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = 'opentodo' # Or path to database file if using sqlite3.
DATABASE_USER = 'root' # Not used with sqlite3.
DATABASE_PASSWORD = 'root' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
# Absolute path to the directory that holds media.
# MEDIA_ROOT = '/var/www/opentodo_media'
MEDIA_ROOT = "C://xampp//htdocs//opentodo_media"
# URL that handles the media served from MEDIA_ROOT.
# Note that this should have a trailing slash if it has a path component
# MEDIA_URL = 'http://static.myhost.ru' or MEDIA_URL = 'http://myhost.ru/static/'
MEDIA_URL = 'http://mtsserver.synaspe.com/opentodo/'
1.python manage.py runserver
2.Через ФФ захожу на localhost:8000/
Результат: логинюсь в opentodo, клацаю линки в результате не выводится не одной картинки.
Лог который при этом выводится в консоль:
C:\django\opentodo>python manage.py runserver3.Захожу на http://mtsserver.synaspe.com/opentodo/
Validating models…
0 errors found
Django version 1.1 beta 1 SVN-10174, using settings ‘opentodo.settings’
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
“GET / HTTP/1.1” 302 0
“GET /tasks/ HTTP/1.1” 200 8020
“GET /main.css HTTP/1.1” 404 3311
“GET /thickbox.css HTTP/1.1” 404 3323
“GET /jquery-1.3.2.min.js HTTP/1.1” 404 3344
“GET /thickbox.js HTTP/1.1” 404 3320
“GET /jquery.simpletip-1.3.1.pack.js HTTP/1.1” 4
“GET /img/bg.gif HTTP/1.1” 404 3317
“GET /img/bg_button_a.gif HTTP/1.1” 404 3344
“GET /img/bg_button_span.gif HTTP/1.1” 404 3353
Результат:
Page not found (404)Привожу urls.py:
Request Method: GET
Request URL: http://mtsserver.synapse.com/opentodo/
Using the URLconf defined in urls, Django tried these URL patterns, in this order:
1. ^$
2. ^logout/$
3. ^accounts/login/$
4. ^admin/(.*)
5. ^media/(?P<path>.*)$
6. ^tasks/$
7. ^tasks/new/$
8. ^tasks/(?P<task_id>\d+)/comments/new/$
9. ^tasks/delete_comment/(?P<comment_id>\d+)/$
10. ^tasks/(?P<task_id>\d+)/$
11. ^tasks/(?P<task_id>\d+)/edit/$
12. ^tasks/(?P<task_id>\d+)/delete/$
13. ^tasks/(?P<task_id>\d+)/to_accepted/$
14. ^tasks/(?P<task_id>\d+)/to_done/$
15. ^tasks/(?P<task_id>\d+)/to_checked/$
16. ^tasks/(?P<task_id>\d+)/to_new/$
17. ^tasks/delete_attach/(?P<attach_id>\d+)/$
18. ^projects/$
19. ^projects/new/$
20. ^projects/(?P<project_id>\d+)/$
21. ^projects/(?P<project_id>\d+)/edit/$
22. ^projects/(?P<project_id>\d+)/delete/$
23. ^projects/delete_attach/(?P<attach_id>\d+)/$
24. ^json/project_users/$
The current URL, opentodo/, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
from django.conf import settings
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^$', 'todo.views.index'),
(r'^logout/$', 'django.contrib.auth.views.logout_then_login'),
(r'^accounts/login/$', 'django.contrib.auth.views.login'),
(r'^admin/(.*)', admin.site.root),
(r'^media/(?P<path>.*)$','django.views.static.serve',{'document_root': '/media'}),
)
urlpatterns += patterns('todo.views',
url(r'^tasks/$', 'list', name='tasks_list'),
url(r'^tasks/new/$', 'add_task', name='add_task'),
url(r'^tasks/(?P<task_id>\d+)/comments/new/$', 'add_comment', name='add_comment'),
url(r'^tasks/delete_comment/(?P<comment_id>\d+)/$', 'del_comment', name='del_comment'),
url(r'^tasks/(?P<task_id>\d+)/$', 'details', name='task_details'),
url(r'^tasks/(?P<task_id>\d+)/edit/$', 'edit', name='edit_task'),
url(r'^tasks/(?P<task_id>\d+)/delete/$', 'delete', name='delete_task'),
url(r'^tasks/(?P<task_id>\d+)/to_accepted/$', 'task_to_accepted', name='task_to_accepted'),
url(r'^tasks/(?P<task_id>\d+)/to_done/$', 'task_to_done', name='task_to_done'),
url(r'^tasks/(?P<task_id>\d+)/to_checked/$', 'task_to_checked', name='task_to_checked'),
url(r'^tasks/(?P<task_id>\d+)/to_new/$', 'task_to_new', name='task_to_new'),
url(r'^tasks/delete_attach/(?P<attach_id>\d+)/$', 'delete_task_attach', name='delete_task_attach'),
url(r'^projects/$', 'projects_list', name='projects_list'),
url(r'^projects/new/$', 'add_project', name='add_project'),
url(r'^projects/(?P<project_id>\d+)/$', 'project_details', name='project_details'),
url(r'^projects/(?P<project_id>\d+)/edit/$', 'edit_project', name='edit_project'),
url(r'^projects/(?P<project_id>\d+)/delete/$', 'delete_project', name='delete_project'),
url(r'^projects/delete_attach/(?P<attach_id>\d+)/$', 'delete_project_attach', name='delete_project_attach'),
url(r'^json/project_users/$', 'json_project_users', name='json_project_users'),
)