if settings.DEBUG: admin.site.site_header = "奇遇淘客 [测试环境]" admin.site.index_title = "奇遇淘客 [测试环境]" admin.site.site_title = "奇遇淘客 [测试环境]" else: admin.site.site_header = "奇遇淘客 [线上环境]" admin.site.index_title = "奇遇淘客 [线上环境]" admin.site.site_title = "奇遇淘客 [线上环境]" urlpatterns = [ # 首页 path("", web_views.IndexView.as_view(), name="index"), # API 接口 path("api/", app.urls), # Web 接口 path("detail/<str:item_id>", web_views.DetailView.as_view(), name="detail"), path("search/", web_views.SearchView.as_view(), name="search"), path("privacy/", PrivacyView.as_view(), name="privacy"), path("taobao/cb", taobao.TaoBaoCB.as_view()), path("ping/", PingView.as_view(), name="ping"), # 语言设置 path("language/<str:language>", ChangeLanguageView.as_view(), name="language"), # 管理后台 path("admin/", admin.site.urls), ] urlpatterns += SERVE_FILE_URLS
from django.conf.urls import url, include from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from django.views.generic import RedirectView, TemplateView from django.core.urlresolvers import reverse_lazy from core.views import PingView urlpatterns = [ url( r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')), url(r'^ping\.json$', PingView.as_view(), name='ping'), url(r'^grappelli/', include('grappelli.urls')), url(r'^admin/', admin.site.urls), url(r'^$', RedirectView.as_view(url=reverse_lazy('markets:home')), name="home"), url(r'^markets/', include('markets.urls'), name="markets"), url(r'^products/', include('products.urls'), name="products"), url(r'^geography/', include('geography.urls'), name="geography"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import url, include from django.contrib import admin from django.conf import settings from django.conf.urls.static import static from django.views.generic import TemplateView from core.views import PingView from markets.views import HomepageView from activitystream.views import ActivityStreamViewSet urlpatterns_unprefixed = [ url(r'^robots\.txt$', TemplateView.as_view( template_name='robots.txt', content_type='text/plain'), name='robots'), url(r'^ping\.json$', PingView.as_view(), name='ping'), url(r'^grappelli/', include('grappelli.urls')), url(r'^admin/', admin.site.urls), url(r'^$', HomepageView.as_view(), name='home'), url(r'^markets/', include('markets.urls'), name="markets"), url(r'^products/', include('products.urls'), name="products"), url(r'^geography/', include('geography.urls'), name="geography"), url(r'^activity-stream/v1/', ActivityStreamViewSet.as_view({'get': 'list'}), name='activity-stream'), ] # to display thumbnails properly MEDIA_URL needs to have added prefix separately urlpatterns = [ url(r'^selling-online-overseas/', include(urlpatterns_unprefixed)) ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)