coding utf-8 from os path import join dirname from django conf import

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-
from os.path import join, dirname
from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin
from os.path import join
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/(.*)', admin.site.root),
(r'', include('etalonkatalog.urls')),
(r'', include('myapp.urls')), #вот тут беда!
)
if settings.DEBUG:
urlpatterns += patterns(
'',
url(r'^media/(.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
url(r'^static/(.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_ROOT}),
url(r'^admin-media/(.*)$', 'django.views.static.serve',
{'document_root': join(dirname(admin.__file__), 'media')}),
)