Ejemplo n.º 1
0
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.conf.urls import url
from django.views.generic import TemplateView
from search.views import SearchSuggest, SearchWeiBoView, IndexView, SearchNewsView, SearchRumorView, SearchAreaView, \
    SearchOverallView, SearchNewsByDayView
from django.conf.urls import include

from sentiment.views import PredictCountViews, WordCountViews, RealTimeDataView

urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^$', IndexView.as_view(), name='index'),
    url(r'^suggest/$', SearchSuggest.as_view(), name='suggest'),
    # url(r'^backend/', include('search.urls')),
    url(r'^searchComment/$', SearchWeiBoView.as_view(), name='weibo_search'),
    url(r'^searchNews/$', SearchNewsView.as_view(), name='news_search'),
    url(r'^searchRumor/$', SearchRumorView.as_view(), name='rumor_search'),
    url(r'^searchArea/$', SearchAreaView.as_view(), name='area_search'),
    url(r'^searchOverall/$',
        SearchOverallView.as_view(),
        name='overall_search'),
    url(r'^sentimentPredict/$',
        PredictCountViews.as_view(),
        name='sentiment_predict'),
    url(r'^sentimentWordCount/$',
        WordCountViews.as_view(),
        name='sentiment_wordcount'),
    url(r'^realTimeData/$', RealTimeDataView.as_view(), name='realtimedata'),
Ejemplo n.º 2
0
"""ChihiroSearch URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.views.generic import TemplateView
from search.views import SearchSuggest, SearchView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', TemplateView.as_view(template_name="index.html")),
    path("suggest", SearchSuggest.as_view(), name="suggest"),
    path("search", SearchView.as_view(), name="search"),
]
Ejemplo n.º 3
0
"""SuperSearch URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.views.generic import TemplateView
from search.views import SearchSuggest, SearchView, IndexView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', IndexView.as_view(), name="index"),
    url(r'^suggest/$', SearchSuggest.as_view(), name="suggest"),
    url(r'^search/$', SearchView.as_view(), name="search"),
]
Ejemplo n.º 4
0
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.conf import settings
from django.urls import path, re_path
from django.views.static import serve

from search.views import IndexView, SearchSuggest, SearchView, favicon_view
from user.views import LoginView, LogoutView, RegisterView

urlpatterns = [
    path('favicon.ico', favicon_view),
    re_path('media/(?P<path>.*)', serve,
            {"document_root": settings.MEDIA_ROOT}),
    path('', IndexView.as_view(), name="index"),
    path('suggest/', SearchSuggest.as_view(), name="suggest"),
    path('search/', SearchView.as_view(), name="search"),
    path('login/', LoginView.as_view(), name="login"),
    path('logout/', LogoutView.as_view(), name="logout"),
    path("register/", RegisterView.as_view(), name="register"),
]
Ejemplo n.º 5
0
from django.conf.urls import url
import xadmin

from front.views import *
from search.views import SearchSuggest, Search
from users.views import *

urlpatterns = [
    # 第三方app相关urls
    path(r'xadmin/', xadmin.site.urls),
    path(r'captcha/', include('captcha.urls')),
    # 首页相关urls
    path(r'', IndexView.as_view(), name='index'),
    path(r'clear_history/', ClearHistory.as_view(), name='clear_history'),
    # 搜索相关urls
    path(r'suggest/', SearchSuggest.as_view(), name='suggest'),
    path(r'search/', Search.as_view(), name='search'),
    # 登录注册相关urls
    path(r'login/', UserLogin.as_view(), name='login'),
    path(r'logout/', UserLogout.as_view(), name='logout'),
    path(r'register/', Register.as_view(), name='register'),
    # ?P提取一个变量作为参数,code是变量, .*是过滤规则(正则表达式),path()全匹配无法正则而url()可以
    url(r'^activate/(?P<activate_code>.*)/$',
        UserActivation.as_view(),
        name='activation'),
    path(r'reset/', ResetPassword.as_view(), name='reset'),
    path(r'verify/', EmailVeriCode.as_view(), name='verify'),
]

# 状态码错误跳转配置
handler500 = 'users.views.server_error'
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.contrib import admin
from django.views.generic import TemplateView
from search.views import SearchSuggest


urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', TemplateView.as_view(), name="index"),

    url(r'^suggest/$', SearchSuggest.as_view(), name="suggest"),  #处理搜索建议  #在\LcvSearch\src\search\views.py 内处理

]





# 在 LcvSearch\src\LcvSearch\settings.py 下配置
"""
Django settings for LcvSearch project.

Generated by 'django-admin startproject' using Django 1.11.

For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
Ejemplo n.º 7
0
"""mtianyanSearch URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.views.generic import TemplateView

from search.views import SearchSuggest, SearchView, IndexView,favicon_view

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', IndexView.as_view(),name = "index"),
    path('suggest/',SearchSuggest.as_view(),name = "suggest"),
    path('search/', SearchView.as_view(), name="search"),
    path('favicon.ico', favicon_view),
]
Ejemplo n.º 8
0
"""VonSearch URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.urls import path
from django.contrib import admin
from django.views.generic import TemplateView

from search.views import SearchSuggest, SearchView

urlpatterns = [
    path('admin/', admin.site.urls),
    # path('', IndexView.as_view(), name="index"),
    path('', TemplateView.as_view(template_name="index.html"), name="index"),
    path('suggestions/', SearchSuggest.as_view(), name="suggestions"),
    path('search/', SearchView.as_view(), name="search"),
]