from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.sitemaps.views import sitemap from registration.backends.default.views import ActivationView from registration.backends.default.views import RegistrationView sitemaps = { 'fun': PostSitemap, } urlpatterns = patterns( 'core.views', # url(r'^$', cache_page(60 * 15)(PostListView.as_view()), name='index'), url(r'^$', PostListView.as_view(), name='index'), url(r'^post/add/$', login_required(PostCreateView.as_view()), name='add_post'), url(r'^category/add/$', login_required(CategoryCreateView.as_view()), name='add_category'), url(r'^category/(?P<name>[-_\w]+)/$', CategoryListPostsView.as_view(), name='list_category'), # url(r'^post/(?P<pk>\d+)/(?P<slug>[-_\w]+)/$', cache_page(60 * 15)(PostDetailView.as_view()), name='post'), url(r'^post/(?P<pk>\d+)/(?P<slug>[-_\w]+)/$', PostDetailView.as_view(), name='post'), url(r'^post/edit/(?P<pk>\d+)/$', login_required(PostEditView.as_view()), name='edit_post'), url(r'^feed/', LastPostsFeed(), name='feed'),
"""drf_api URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.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.contrib import admin from django.urls import path, include from core.views import PostView, PostCreateView from rest_framework.authtoken.views import obtain_auth_token urlpatterns = [ path('admin/', admin.site.urls), path('', PostView.as_view(), name='test'), path('api-auth/', include('rest_framework.urls')), path('api/token/', obtain_auth_token, name='obtain_token'), path('rest-auth/', include('rest_auth.urls')), path('create/', PostCreateView.as_view(), name='create'), ]
from django.contrib import admin from django.urls import path,include from core.views import PostApiView,PostCreateView,PostListCreateApiView from rest_framework.authtoken.views import obtain_auth_token urlpatterns = [ path('admin/', admin.site.urls), path('dj-rest-auth/', include('dj_rest_auth.urls')), path('api-auth/', include('rest_framework.urls')), path('',PostApiView.as_view(), name="login"), path('create/',PostCreateView.as_view(), name="create"), path('create-api/',PostListCreateApiView.as_view(), name="create-api"), path('api/token/',obtain_auth_token, name='obtain-token') ]
from django.conf.urls.static import static from core.views import UserIDView, CommentView, UserProfileView, LikesView, UserProfileEditView, FollowingUserPosts, \ PostViewSets, PostDetailView, PostCreateView, FollowersListView, FollowingListView urlpatterns = [ path('api-auth/', include('rest_framework.urls')), path('rest-auth/', include('rest_auth.urls')), path('rest-auth/registration/', include('rest_auth.registration.urls')), path('admin/', admin.site.urls), path('api/user-id/', UserIDView.as_view(), name='user-id'), path('api/comment/', CommentView.as_view(), name='comment'), path('api/profile/<username>/', UserProfileView.as_view(), name='profile'), path('api/profile/<username>/follow/', UserProfileView.as_view(), name='follow'), path('api/likes/', LikesView.as_view(), name='follow'), path('api/profile/<pk>/edit/', UserProfileEditView.as_view(), name='profile-edit'), path('api/post/<pk>/', PostDetailView.as_view(), name='post-detail'), path('api/userfeed/', FollowingUserPosts.as_view(), name='profile-edit'), path('api/posts/', PostViewSets.as_view(), name='list-posts'), path('api/create/', PostCreateView.as_view(), name='post-create'), path('api/<username>/followers/', FollowersListView.as_view(), name='user-followers'), path('api/<username>/following/', FollowingListView.as_view(), name='user-following'), ] if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if not settings.DEBUG: urlpatterns += [re_path(r'^.*', TemplateView.as_view(template_name='index.html')), ]
"""drf_api 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 core.views import PostCreateView, PostListCreateView, PostView, TestView from django.contrib import admin from django.urls import include, path from rest_framework.authtoken.views import obtain_auth_token urlpatterns = [ path("api-auth/", include("rest_framework.urls")), path("rest-auth/", include("rest_auth.urls")), path("admin/", admin.site.urls), path("", PostView.as_view(), name="test"), path("create/", PostCreateView.as_view(), name="create"), path("list-create/", PostListCreateView.as_view(), name="list-create"), path("api/token/", obtain_auth_token, name="obtain-token"), ]
from django.conf.urls.defaults import * from django.conf import settings from core.views import PostListView, PostCreateView, TagListView, PostDetailView, PostUpdateView, PostDeleteView urlpatterns = patterns('homepage.views', #url(r'^$', 'home', name="home"), url(r'^$', PostListView.as_view(), name="post-list"), url(r'^add/$', PostCreateView.as_view(), name='post-create'), url(r'^tags/$', TagListView.as_view(), name='tag-list'), url(r'^(?P<pk>[\w\d]+)/$', PostDetailView.as_view(), name='post-detail'), url(r'^(?P<pk>[\w\d]+)/edit/$', PostUpdateView.as_view(), name='post-update'), url(r'^(?P<pk>[\w\d]+)/delete/$', PostDeleteView.as_view(), name='post-delete'), )
# http://django-allauth.readthedocs.io/en/latest/installation.html#django url(r'^accounts/', include('allauth.urls')), url(r'^accounts/basic/$', UserUpdateView.as_view(), name='userprofile_basic'), url(r'^accounts/advanced/$', UserProfileUpdateView.as_view(), name='userprofile_advanced'), # pinax-messages: Added URL for Messages. url(r"^messages/", include("pinax.messages.urls", namespace="pinax_messages")), url(r'^user/(?P<username>[-\w]{5,30})/$', UserProfileDetailView.as_view(), name='userprofile'), # Post: CRUD url's. url(r'^post/create/$', PostCreateView.as_view(), name='post_create'), url(r'^post/(?P<pk>\d+)/$', PostDetailView.as_view(), name='post_detail'), url(r'^post/(?P<pk>\d+)/delete/$', PostDeleteView.as_view(), name='post_delete'), # Post Comments: CRUD url's. url(r'^post/(?P<pk>\d+)/comment/$', CommentCreateView.as_view(), name='post_comment_create'), # django-activity-stream: Testing URL url('^activity/', include('actstream.urls')), url(r'^u/(?P<username>[-\w]{5,30})/followers/$', FollowersListView.as_view(), name='followers'), url(r'^u/(?P<username>[-\w]{5,30})/following/$', FollowingListView.as_view(),
from core.forms import CaptchaRegistrationForm from core.sitemap import PostSitemap from django.views.generic.base import TemplateView from django.contrib.auth.decorators import login_required from django.contrib.sitemaps.views import sitemap from registration.backends.default.views import ActivationView from registration.backends.default.views import RegistrationView sitemaps = { 'fun': PostSitemap, } urlpatterns = patterns('core.views', # url(r'^$', cache_page(60 * 15)(PostListView.as_view()), name='index'), url(r'^$', PostListView.as_view(), name='index'), url(r'^post/add/$', login_required(PostCreateView.as_view()), name='add_post'), url(r'^category/add/$', login_required(CategoryCreateView.as_view()), name='add_category'), url(r'^category/(?P<name>[-_\w]+)/$', CategoryListPostsView.as_view(), name='list_category'), # url(r'^post/(?P<pk>\d+)/(?P<slug>[-_\w]+)/$', cache_page(60 * 15)(PostDetailView.as_view()), name='post'), url(r'^post/(?P<pk>\d+)/(?P<slug>[-_\w]+)/$', PostDetailView.as_view(), name='post'), url(r'^post/edit/(?P<pk>\d+)/$', login_required(PostEditView.as_view()), name='edit_post'), url(r'^feed/', LastPostsFeed(), name='feed'), url(r'^profile/(?P<pk>\d+)/$', login_required(AuthorDetailView.as_view()), name='profile'), url(r'^profile/(?P<pk>\d+)/edit/$', login_required(AuthorUpdateView.as_view()), name='edit_profile'), url(r'^activate/complete/$', TemplateView.as_view(template_name='registration/activation_complete.html'), name='registration_activation_complete'), url(r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view(), name='registration_activate'), url(r'^register/$', RegistrationView.as_view(form_class=CaptchaRegistrationForm), name='registration_register'), url(r'^register/complete/$', TemplateView.as_view(template_name='registration/registration_complete.html'), name='registration_complete'), url(r'^rating/(?P<id>\d+)/(?P<slug>[-_\w]+)/up/$', 'rating_up', name='rating_up'), url(r'^rating/(?P<id>\d+)/(?P<slug>[-_\w]+)/down/$', 'rating_down', name='rating_down'), url(r'^search_results/', 'search', name='search'),
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 core.views import home, register, profile, PostListView, PostDetailView, PostCreateView, PostUpdateView, PostDeleteView from django.contrib.auth import views as auth_views from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('home/', PostListView.as_view(), name='home'), path('post/<int:pk>/', PostDetailView.as_view(), name='post-detail'), path('post/new/', PostCreateView.as_view(), name='post-create'), path('post/<int:pk>/update/', PostUpdateView.as_view(), name='post-update'), path('post/<int:pk>/delete/', PostDeleteView.as_view(), name='post-delete'), path('register/', register, name='register'), path('profile/', profile, name='profile'), path('login/', auth_views.LoginView.as_view(template_name='login.html'), name='login'), path('logout/', auth_views.LogoutView.as_view(template_name='logout.html'), name='logout'), ] if settings.DEBUG: