Beispiel #1
0
"""hypernews URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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 news.views import MainPageView, NewsView, AllNewsPage, CreateNews
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('admin/', admin.site.urls),
    path("", MainPageView.as_view()),
    path("news/", AllNewsPage.as_view()),
    path("news/<int:link_number>/", NewsView.as_view()),
    path("news/create/", CreateNews.as_view()),
]

urlpatterns += static(settings.STATIC_URL)
"""hypernews URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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, re_path
from news.views import MainView, NewsView, NewsList, CreateView

urlpatterns = [
    path('admin/', admin.site.urls),
    re_path("news/(?P<n_chapter>\d+)/", NewsView.as_view()),
    path("news/", NewsList.as_view()),
    path("news/create/", CreateView.as_view()),
    path("", MainView.as_view())
]
Beispiel #3
0
    https://docs.djangoproject.com/en/2.2/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, re_path
from news.views import IndexView, NewsDetailView, NewsView, CreateArticleView
from django.views.generic import RedirectView
from django.conf.urls.static import static
from hypernews.settings import STATIC_URL

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', RedirectView.as_view(url='news/')),
    re_path(r'^news/[0-9]+', NewsDetailView.as_view()),
    path('news/', NewsView.as_view()),
    path('news', RedirectView.as_view(url='news/')),
    path('news/create/', CreateArticleView.as_view()),
    path('news/create', RedirectView.as_view(url='/news/create/'))
]

urlpatterns += static(STATIC_URL)
Beispiel #4
0
"""hypernews URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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('article/', include('article.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path
from news.views import NewsView, MainPageView, ArticleView, CreateView

urlpatterns = [
    path('news/', MainPageView.as_view()),
    path('news/create/', CreateView.as_view()),
    re_path("news/(?P<article_id>[^/]*)/?", ArticleView.as_view(), name='news'),
    path('', NewsView.as_view()),
]
Beispiel #5
0
"""hypernews URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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 news.views import ComingSoonView, NewsView, WelcomeView, CreateNewsView

urlpatterns = [
    path('news/create/', CreateNewsView.as_view()),
    path('', ComingSoonView.as_view()),
    path('news/<link>/', NewsView.as_view()),
    path('news/', WelcomeView.as_view()),
]
Beispiel #6
0
"""activities URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/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. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from news.views import NewsView

app_name = "news"

urlpatterns = [
    url(r'^$', NewsView.as_view(), name="news")
]
from django.urls import path

from news.views import NewsView

app_name = 'news'
urlpatterns = [path('news/', NewsView.as_view(), name='api-news')]
Beispiel #8
0
# -*- coding: utf-8 -*-
from django.urls import path
from django.utils.translation import ugettext_lazy as _

from news.views import NewsView

app_name = 'news'

urlpatterns = [path('news/', NewsView.as_view(), name='news_page')]
Beispiel #9
0
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from TestCorpus.views import Index, Search, Statistics, PopUp, download_file
from news.views import NewsView, SectionView
from annotator.admin import learner_admin

urlpatterns = patterns(
    '',
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),  # документация
    url(r'^admin/', include(learner_admin.urls)
        ),  # все страницы, связанные с панелью администратора
    url(r'^(help|rulec)$', Index.as_view(),
        name='main.static'),  # страница помощи и страница рулека
    url(r'^(search)/$', Search.as_view(),
        name='main.search'),  # страница поиска
    url(r'^(news)$', NewsView.as_view(), name='news'),  # новости
    url(r'^$', SectionView.as_view(), name='start_page'),  # стартовая
    url(r'^search/(gramsel|lex|errsel)$', PopUp.as_view(),
        name='popup'),  # окна с чекбоксами
    url(r'^(stats)/$', Statistics.as_view(), name='main.stats'),  # статистика
    url(r'^(download_file)/(?P<doc_id>[\w\-]+)/(?P<doc_type>ann|tokens|text)$',
        download_file,
        name='download_file'),
    # скачивание текста или разметки
    url(r'^document-annotations',
        include('annotator.urls')),  # все страницы, связанные с разметкой
    (r'^i18n/', include('django.conf.urls.i18n')),  # интернационализация
)

urlpatterns += staticfiles_urlpatterns()
Beispiel #10
0
"""hypernews URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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 news.views import UnderConstructionPageView, NewsView, NewsIndexPageView, CreateNews
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('admin/', admin.site.urls),
    path('news/', NewsIndexPageView.as_view(), name="news_index"),
    path('news/create/', CreateNews.as_view(), name="news_create"),
    path('news/<int:news_id>/', NewsView.as_view(), name="news_detail"),
    path('', UnderConstructionPageView.as_view(), name="site_index"),
]

urlpatterns += static(settings.STATIC_URL)
Beispiel #11
0
"""hypernews URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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, re_path
from news.views import AllNewsView, NewsView, MainView, CreateNewsView

urlpatterns = [
    path("", MainView.as_view()),
    path("news/", AllNewsView.as_view()),
    path("news/create/", CreateNewsView.as_view()),
    path("news/<int:news_id>/", NewsView.as_view()),
]
Beispiel #12
0
"""hypernews URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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 news.views import IndexView, NewsView, MainView, CreateView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', IndexView.as_view()),
    path('news/create/', CreateView.as_view()),
    path('news/<int:item_id>/', NewsView.as_view()),
    path('news/', MainView.as_view())

]
Beispiel #13
0
from django.conf.urls import url

from news.views import NewsCreateView, NewsView, AllNewsView, NewsUpdate

urlpatterns = [
    url(r'^create$', NewsCreateView.as_view(), name='news_create'),
    url(r'^(?P<pk>\d+)$', NewsView.as_view(), name='news_view'),
    url(r'^all/(?P<page>\d+)$', AllNewsView.as_view(), name='news_list'),
    url(r'^(?P<pk>\d+)/edit$', NewsUpdate.as_view(), name='news_update'),
]
Beispiel #14
0
from django.urls import path, re_path
from news.views import NewsView, NewsListView, NewsCreateView

urlpatterns = [
    path('', NewsListView.as_view(), name='news_list'),
    path('create/', NewsCreateView.as_view(), name='news_create'),
    re_path("(?P<link>[^/]*)/?", NewsView.as_view(), name='news'),
]
Beispiel #15
0
from django.conf.urls import url

from news.views import NewsView, AddNewsView, NewsPremoderationMessageView, NewsDetailView, EditNewsView

urlpatterns = [
    url(r'^add$', AddNewsView.as_view(), name='add-news'),
    url(r'^added$', NewsPremoderationMessageView.as_view(), name='news-added'),
    url(r'^edit/(?P<pk>[0-9]+)/?$', EditNewsView.as_view(), name='edit-news'),
    url(r'(?P<pk>[0-9]+)', NewsDetailView.as_view(), name='news-detail'),
    url(r'', NewsView.as_view(), name='news'),
]

Beispiel #16
0
#  -- coding: utf8 --

from django.conf.urls import patterns, include, url
from Corpus.views import Index, Search, Statistics, PopUp
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from news.views import NewsView, SectionView
from annotator.admin import learner_admin

urlpatterns = patterns(
    '',
    url(r'^admin/', include(learner_admin.urls)),
    url(r'^(help)/$', Index.as_view(), name='main.static'),
    url(r'^news/$', NewsView.as_view(), name='news'),
    url(r'^search/$', Search.as_view(), name='main.search'),
    url(r'^search/(gramsel|lex|errsel)$', PopUp.as_view(), name='popup'),
    url(r'^stats/$', Statistics.as_view(), name='main.stats'),
    url(r'^document-annotations', include('annotator.urls')),
    (r'^i18n/', include('django.conf.urls.i18n')),
    url(r'^$', SectionView.as_view(), name='start_page'),
)

urlpatterns += staticfiles_urlpatterns()
Beispiel #17
0
from django.urls import path
from django.conf.urls import url
from news.views import NewsListView, NewsView, SubmitArticleView, simple_upload

urlpatterns = [
    path('', NewsListView.as_view(), name='news_list'),
    path('<str:tag>', NewsListView.as_view(), name='news_list'),
    path('article/<slug:slug>/', NewsView.as_view(), name='news'),
    path('submit-new/', SubmitArticleView.as_view(), name='submit-news'),
    url(r'^upload-image/', simple_upload, name='upload-image'),
]
Beispiel #18
0
"""financial_news 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'))
"""
from django.contrib import admin
from django.urls import path

from news.views import NewsView, NewsCategoryView

urlpatterns = [
    path("admin/", admin.site.urls),
    path("api/news/", NewsView.as_view({"get": "list"})),
    path("api/news/category/", NewsCategoryView.as_view()),
]
Beispiel #19
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from TestCorpus.views import Index, Search, Statistics, PopUp
from news.views import NewsView, SectionView
from annotator.admin import learner_admin

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'learner_corpus.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),
    # url(r'^myadmin/', include(learner_admin.urls)),

    url(r'^admin/', include(learner_admin.urls)),
    url(r'^(news)$', NewsView.as_view(), name='news'),
    url(r'^(search)/$', Search.as_view(), name='main.search'),
    url(r'^(help)$', Index.as_view(), name='main.static'),
    url(r'^$', SectionView.as_view(), name='start_page'),
    url(r'^search/(gramsel|lex|errsel)$', PopUp.as_view(), name='popup'),
    url(r'^(stats)/$', Statistics.as_view(), name='main.stats'),
    url(r'^document-annotations', include('annotator.urls')),
    (r'^i18n/', include('django.conf.urls.i18n')),
    )
Beispiel #20
0
"""hypernews URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/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.urls import path
from news.views import BaseView, NewsView, MainView, CreateView
from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
    path('', BaseView.as_view()),
    path('news/<int:news_id>/', NewsView.as_view()),
    path('news/', MainView.as_view(), name='main'),
    path('news/create/', CreateView.as_view(), name='create'),
] + static(settings.STATIC_URL)