This project contains reference examples for writing Django View with functional and OOP paradigms.
- GET, POST
http://127.0.0.1:8000/apis/{version_number}/{plural-model-name}/
- GET, PUT, DELETE
http://127.0.0.1:8000/apis/{version_number}/{plural-model-name}/{lookup}/
Example:
- GET, POST
http://127.0.0.1:8000/apis/1.0/persons/
- GET, PUT, DELETE
http://127.0.0.1:8000/apis/1.0/persons/{lookup}/
urlpatterns = [
path("admin/", admin.site.urls), # Admin urls
path("", include("coreapp.urls")), # General link for other applications
path("f1/", include("f1.urls")), # Function Base 1(Bare metal - lack of validations and security)
path("f2/", include("f2.urls")), # Function Base 2(With forms.Forms)
path("f3/", include("f3.urls")), # Function Base 3(With ModelForm)
path("c1/", include("c1.urls")), # Class Base 1(With forms.Forms)
path("c2/", include("c2.urls")), # Class Base 2(With ModelForm)
path("c3/", include("c3.urls")), # Class Base 3(Generic Class Base View)
path("apis/1.0/", include("apis1.urls")), # API 1(Function Base Views)
path("apis/2.0/", include("apis2.urls")), # API 2(Class Base Views)
path("apis/3.0/", include("apis3.urls")), # API 3(Generic Class Base Views)
]
Anyone who want to learn different paradigm approach about writing view in Django.
- The program runs on Django Web Framework so any web server which run Django is enough.
- A little passion.
- Install Django
- Or just run
$ pip install -r requirements.txt
- To use the application, start by creating a Django Project with proper database.
- A large screen tablet will make things a lot easier.
code blocks for commands
If you have any question don't hesitate to ask.
command to run if program contains helper info
Contributors names and contact info
ex. OHA TEAM
ex. @OHA
- 0.2
- This is beta version for now
- See commit change or See release history
- 0.1
- Initial Release
This project is licensed under the [GNU] GNU General Public License - see the LICENSE.md file for details
Inspiration, code snippets, etc.