"""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.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path, re_path from news.views import ComingSoon, MainPage, NewPost, CreateNews urlpatterns = [ path('admin/', admin.site.urls), path('', ComingSoon.as_view(), name="index"), path('news/', MainPage.as_view()), path('news/create/', CreateNews.as_view()), re_path("news/(?P<news_id>[^/]*)/?", NewPost.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 news.views import NewsView, MainPageView, NewsMain, CreateNews from django.urls import path, re_path from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path("", MainPageView.as_view()), path("news/", NewsMain.as_view()), path("news/create/", CreateNews.as_view()), path("news/<int:link>/", NewsView.as_view()), # path('admin/', admin.site.urls), ] urlpatterns += static(settings.STATIC_URL)
from django.urls import path from news.views import Newslist, NewsDetail, CreateNews, NewsUpdateView app_name = 'news' urlpatterns = [ path('news/', Newslist.as_view(), name='news_list'), path('news/create/', CreateNews.as_view(), name='add_news'), path('news/<slug:slug>/', NewsDetail.as_view(), name='news_detail'), path('news/<slug:slug>/edit/', NewsUpdateView.as_view(), name='news_edit'), ]
"""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)