2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) """ from django.conf.urls import include, url, patterns from django.contrib import admin from tweets.views import (Index, Profile, PostTweet, HashTagCloud, Search, UserRedirect, MostFollowedUsers, Register) admin.autodiscover() urlpatterns = patterns('', url(r'^$', Index.as_view()), url(r'^user/(\w+)/$', Profile.as_view()), url(r'^admin/', include(admin.site.urls)), url(r'^user/(\w+)/post/$', PostTweet.as_view()), url(r'hashtag/(\w+)/$', HashTagCloud.as_view()), url(r'^search/$', Search.as_view()), url(r'^login/$', 'django.contrib.auth.views.login'), url(r'^logout/$', 'django.contrib.auth.views.logout'), url(r'^profile/$', UserRedirect.as_view()), url(r'^mostFollowed/$', MostFollowedUsers.as_view()), url(r'^user/(\w+)/?page=<page_number>', Profile.as_view()), url(r'register/$', Register.as_view()) )
from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth.views import login, logout from tweets.views import Index, Profile, PostTweet, HashTagCloud, Search, MostFollowedUsers, UserLogin, UserLogout, UserRedirect admin.autodiscover() urlpatterns = [ url(r'^$', Index.as_view()), url(r'^user/(\w+)/$', Profile.as_view()), url(r'^admin/', admin.site.urls), url(r'^user/(\w+)/post/$', PostTweet.as_view()), url(r'^hashTag/(\w+)/$', HashTagCloud.as_view()), url(r'^search/$', Search.as_view()), url(r'^profile/$', UserRedirect.as_view()), url(r'^mostFollowed/$', MostFollowedUsers.as_view()), url(r'^login/$', UserLogin.as_view()), url(r'^logout/$', UserLogout.as_view()), url(r'^invite/$', Invite.as_view()), url(r'^invite/accept/(\w+)/$', InviteAccept.as_view()), ]
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, patterns, include from django.contrib import admin from tweets.views import Index, Profile, PostTweet, HashTagCloud, Search from user_profile.views import UserRedirect, MostFollowedUsers, Invite, InviteAccept admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^user/(\w+)/$', Profile.as_view()), url(r'^user/(\w+)/post/$', PostTweet.as_view()), url(r'^hashTag/(\w+)/$', HashTagCloud.as_view()), url(r'^$', Index.as_view()), url(r'^search/$', Search.as_view()), url(r'^search/post$', Search.as_view()), url(r'^login/$', 'django.contrib.auth.views.login'), url(r'^logout/$', 'django.contrib.auth.views.logout'), url(r'^profile/$', UserRedirect.as_view()), url(r'^mostFollowed/$', MostFollowedUsers.as_view()), url(r'^invite/$', Invite.as_view()), url(r'^invite/accept/(\w+)/$', InviteAccept.as_view()), )