{"id":19021642,"url":"https://github.com/buildwithlal/django-cbvpatterns","last_synced_at":"2026-06-22T17:32:02.078Z","repository":{"id":144099524,"uuid":"139834804","full_name":"BuildWithLal/django-cbvpatterns","owner":"BuildWithLal","description":null,"archived":false,"fork":false,"pushed_at":"2018-08-06T12:00:24.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-21T18:31:21.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BuildWithLal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-05T10:40:07.000Z","updated_at":"2018-08-06T12:00:25.000Z","dependencies_parsed_at":"2023-04-23T05:48:05.300Z","dependency_job_id":null,"html_url":"https://github.com/BuildWithLal/django-cbvpatterns","commit_stats":null,"previous_names":["buildwithlal/django-cbvpatterns"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BuildWithLal/django-cbvpatterns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildWithLal%2Fdjango-cbvpatterns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildWithLal%2Fdjango-cbvpatterns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildWithLal%2Fdjango-cbvpatterns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildWithLal%2Fdjango-cbvpatterns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BuildWithLal","download_url":"https://codeload.github.com/BuildWithLal/django-cbvpatterns/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BuildWithLal%2Fdjango-cbvpatterns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34659896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T20:22:51.301Z","updated_at":"2026-06-22T17:32:02.058Z","avatar_url":"https://github.com/BuildWithLal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Django cbvpatterns\n==================\n\nA nicer version of `patterns()` for use with class based views. Inspired\nlargely by Loic. This is an improved version of [mjtamlyn cbvpatterns](https://github.com/mjtamlyn/django-cbvpatterns) to support latest versions of Django\n\nDjango supported versions\n-------------\n    Django 1.10\n    Django 1.11\n    Django 2.0\n    Django 2.1b1\n\nWhat is this?\n-------------\n\nIf you're a big fan of class based views in Django or you want to import views from one module\nto another module's `urls.py` you might often find your `urls.py` starting to look a little cluttered. Something like::\n\n    from django.conf.urls import url\n    from django.urls import path, re_path # Django \u003e= 2.0\n\n    from account.user import views as userViews\n    from github.projects import views as githubViews\n    from favorite.wishlist import views as wishlistViews\n\n    # Django \u003c 2.0\n    urlpatterns = [\n        url(r'^user/login/$', userViews.login, name='login'),\n        url(r'^github/projects/$', githubViews.projects, name='projects'),\n        url(r'^wishlist/(?P\u003cpk\u003e\\d+)/$', wishlistViews.wishlist, name='wishlist-detail'),\n    ]\n\n    # Django \u003e= 2.0\n    urlpatterns = [\n        path('user/login', userViews.login, name='login'),\n        path('github/projects', githubViews.projects, name='projects'),\n        re_path(r'^wishlist/(?P\u003cpk\u003e\\d+)', wishlistViews.wishlist, name='wishlist-detail'),\n    ]\n\nSo we can now have a class based view or functional view which has the same feel::\n\n    from cbvpatterns import url\n    from cbvpatterns import path, re_path # Django \u003e= 2.0\n\n    # no need to import views from other modules\n\n    # Django \u003c 2.0\n    urlpatterns = [\n        url(r'^user/login/$', 'account.user.views.login', name='login'),\n        url(r'^github/projects/$', 'github.projects.views.projects', name='projects'),\n        url(r'^wishlist/(?P\u003cpk\u003e\\d+)/$', 'favorite.wishlist.views.wishlist', name='wishlist-detail'),\n    ]\n\n    # Django \u003e= 2.0\n    urlpatterns = [\n        path('user/login', 'account.user.views.login', name='login'),\n        path('github/projects', 'github.projects.views.projects', name='projects'),\n        re_path(r'^wishlist/(?P\u003cpk\u003e\\d+)', 'favorite.wishlist.views.wishlist', name='wishlist-detail'),\n    ]\n\nYou can also pass in the actual view classes directly, rather than using the\nstring representation.\n\n##### NOTE:\nYou can only import url from cbvpatterns if you are using Django \u003c 2.0 \u003cbr/\u003e\nYou can only import path, re_path from cbvpatterns if you are using Django \u003e= 2.0\n\nContributing\n------------\n\nDevelopment takes place\n`on GitHub \u003chttp://github.com/lalzada/django-cbvpatterns\u003e`_; pull requests are\nwelcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildwithlal%2Fdjango-cbvpatterns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuildwithlal%2Fdjango-cbvpatterns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuildwithlal%2Fdjango-cbvpatterns/lists"}