from django.conf.urls import url from accounts.views import AccountList, AccountDetail, ContactList, ContactDetail urlpatterns = [ url( r'^accounts$', AccountList.as_view() ), url( r'^accounts/(?P<pk>[0-9]+)$', AccountDetail.as_view() ), url( r'^contacts$', ContactList.as_view() ), url( r'^contacts/(?P<pk>[0-9]+)$', ContactDetail.as_view() ) ]
from django.conf.urls import patterns, include, url from django.contrib import admin from marketing.views import HomePage from accounts.views import AccountList from accounts.urls import account_urls from contacts.urls import contact_urls from contacts.views import ContactDelete from communications.urls import comm_urls from communications.views import CommDelete urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^$', HomePage.as_view(), name="home"), url(r'^signup/$', 'brankocrm.subscribers.views.subscriber_new', name='sub_new'), url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}), url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/login/'}), url(r'^account/new/$', 'brankocrm.accounts.views.account_cru', name='account_new'), url(r'^account/list/$', AccountList.as_view(), name='account_list'), url(r'^account/(?P<uuid>[\w-]+)/', include(account_urls)), url(r'^contact/new/$', 'brankocrm.contacts.views.contact_cru', name='contact_new'), url(r'^contact/(?P<uuid>[\w-]+)/', include(contact_urls)), url(r'^contact/(?P<pk>[\w-]+)/delete/$',ContactDelete.as_view(), name='contact_delete'), url(r'^comm/new/$', 'brankocrm.communications.views.comm_cru', name='comm_new'), url(r'^comm/(?P<uuid>[\w-]+)/', include(comm_urls)), url(r'^comm/(?P<pk>[\w-]+)/delete/$', CommDelete.as_view(), name='comm_delete'), )
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, include from django.contrib import admin from django.contrib.auth import views as auth_views from marketting import views from subscribers.views import subscribe_new from accounts.views import AccountList from accounts.urls import account_urls from accounts.views import create_new_account urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', views.HomePage.as_view(), name="home"), url(r'^sign-up/$', subscribe_new, name="signup"), url(r'^login$', auth_views.login, {'template_name': 'login.html'}, name='login'), url(r'^logout$', auth_views.logout, {'next_page': '/login'}, name='logout'), url(r'^account/list', AccountList.as_view(), name='account-list'), url(r'^account/new/$', create_new_account, name='new-account'), url(r'^account/(?P<uuid>[\w-]+)/', include(account_urls)), ]
from django.urls import path from rest_framework_simplejwt import views as jwt_views from accounts.views import ( AccountLogin, AccountRegistration, AccountList, AccountDetail, ) urlpatterns = [ path('token/obtain/', jwt_views.TokenObtainPairView.as_view(), name="token-create"), path('token/refresh/', jwt_views.TokenRefreshView.as_view(), name="token-refresh"), path('login/', AccountLogin.as_view(), name="account-login"), path('register/', AccountRegistration.as_view(), name="account-registration"), path('accounts/', AccountList.as_view(), name="account-list"), path(r'accounts/<int:account_id>/', AccountDetail.as_view(), name='account-update'), ]
url(r'^login/$', login,{'template_name': 'login.html'}, name='django.contrib.auth.views.login'), url(r'^logout/$', logout, {'next_page': '/login/'} ), # Account related URLs url(r'^account/new/$', account_cru, name='crmapp.accounts.views.account_cru' ), url(r'^account/new/$', account_cru, name='account_new' ), url(r'^account/list/$', AccountList.as_view(), name='account_list' ), url(r'^account/(?P<uuid>[\w-]+)/', include(account_urls)), # Contact related URLS url(r'^contact/new/$', contact_cru, name='contact_new' ), url(r'^contact/(?P<uuid>[\w-]+)/', include(contact_urls)), url(r'^contact/(?P<pk>[\w-]+)/delete/$', ContactDelete.as_view(), name='contact_delete' ), # Communication related URLs url(r'^comm/new/$', comm_cru, name='comm_new' ),
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.contrib import admin from django.urls import path, include from marketing.views import HomePage from subscribers.views import subscriber_new from django.contrib.auth.views import LoginView, LogoutView from accounts.views import AccountList from accounts.views import account_cru urlpatterns = [ path('admin/', admin.site.urls), path('', HomePage.as_view(), name="home"), path('signup/',subscriber_new, name='sub_new'), path('account/list/', AccountList.as_view(), name='account_list'), path('login/', LoginView.as_view(template_name="login.html"), name="user_login"), path('logout/', LogoutView.as_view(), name='home'), path('account/<int:uuid>/', include('accounts.urls')), path('account/new/', account_cru, name='account_new'), ]
(r'^admin/', include(admin.site.urls)), # Login/Logout URLs (r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'} ), (r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/login/'} ), # Account related URLs url(r'^account/new/$', 'crmapp.accounts.views.account_cru', name='account_new' ), url(r'^account/list/$', AccountList.as_view(), name='account_list' ), url(r'^account/(?P<uuid>[\w-]+)/', include(account_urls)), # Contact related URLS url(r'^contact/(?P<pk>[\w-]+)/delete/$', ContactDelete.as_view(), name='contact_delete' ), url(r'^contact/new/$', 'crmapp.contacts.views.contact_cru', name='contact_new' ), url(r'^contact/(?P<uuid>[\w-]+)/', include(contact_urls)), # Communication related URLs url(r'^comm/new/$', 'crmapp.communications.views.comm_cru', name='comm_new'
from communications.urls import comm_urls from communications.views import CommDelete admin.autodiscover() urlpatterns = patterns( "", url(r"^admin/", include(admin.site.urls)), # Marketing pages url(r"^$", HomePage.as_view(), name="home"), # Subscriber related URLs url(r"^signup/$", "subscribers.views.subscriber_new", name="sub_new"), # Admin URL (r"^admin/", include(admin.site.urls)), # Login/Logout URLs (r"^login/$", "django.contrib.auth.views.login", {"template_name": "login.html"}), (r"^logout/$", "django.contrib.auth.views.logout", {"next_page": "/login/"}), # Account related URLs url(r"^account/new/$", "crmapp.accounts.views.account_cru", name="account_new"), url(r"^account/list/$", AccountList.as_view(), name="account_list"), url(r"^account/(?P<uuid>[\w-]+)/", include(account_urls)), # Contact related URLS url(r"^contact/new/$", "crmapp.contacts.views.contact_cru", name="contact_new"), url(r"^contact/(?P<uuid>[\w-]+)/", include(contact_urls)), # Communication related URLs url(r"^comm/new/$", "crmapp.communications.views.comm_cru", name="comm_new"), url(r"^comm/(?P<uuid>[\w-]+)/", include(comm_urls)), url(r"^comm/(?P<pk>[\w-]+)/delete/$", CommDelete.as_view(), name="comm_delete"), )
from django.urls import path from accounts.views import AccountList urlpatterns = [path("", AccountList.as_view(), name="account-list")]
from django.urls import path, re_path, include from marketing.views import HomePage from subscribers.views import subscriber_new from django.contrib.auth.views import LoginView, LogoutView from accounts.views import AccountList, account_cru from accounts.urls import account_urls from contacts.urls import contact_urls from contacts.views import contact_cru from contacts.views import ContactDelete from communications.urls import comm_urls urlpatterns = [ path('admin/', admin.site.urls), path('', HomePage.as_view(), name="home"), path('signup/', subscriber_new, name='sub_new'), path('login/', LoginView.as_view(template_name='login.html'), name='login'), path('logout/', LogoutView.as_view(next_page='/login/')), re_path(r'^account/new/$', account_cru, name='account_new'), re_path(r'^account/list/$', AccountList.as_view(), name='account_list'), #re_path(r'^account/(?P<uuid>[\w-]+)/', include(account_urls)), re_path(r'^account/(?P<uuid>\w+)/', include(account_urls)), #re_path(r'^account/(?P<uuid>)/', include(account_urls)), re_path(r'^contact/new/$', contact_cru, name='contact_new'), re_path(r'^contact/(?P<uuid>[\w-]+)/', include(contact_urls)), re_path(r'^contact/(?P<pk>[\w-]+)/delete/$', ContactDelete.as_view(), name='contact_delete'), re_path(r'^comm/(?P<uuid>[\w-]+)/', include(comm_urls)), ]