HackSoftware /Django-Styleguide
Django styleguide used in HackSoft projects
★ 6,308⑂ 620👁 137⑃ 62● 108▤ 0
6,308
stars
+0+1+5
620
forks
137
watchers
62
prs
108
issues
0
releases
–
discussions
README
Django Styleguide 👀 Need help with your Django project? HackSoft is here for you. Reach out at [email protected] !Django Styleguide Table of contents: - How to ask a question or propose something? - What is this? - How to use it? - Overview - Why not? - Cookie Cutter - Models - Base model - Validation - clean and full_clean - Validation - constraints - Properties - Methods - Testing - Services - Example - function-based service - Example - class-based service - Naming convention - Modules - Selectors - Testing - APIs & Serializers - Naming convention - Class-based vs. Function-based - List APIs - Plain - Filters + Pagination - Detail API - Create API - Update API - Fetching objects - Nested serializers - Advanced serialization - Urls - Settings - Prefixing environment variables with DJANGO_ - Integrations - Reading from .env - Errors & Exception Handling - How exception handling works (in the context of DRF) - DRF's ValidationError - Django's ValidationError - Describe how your API errors are going to look like. - Know how to change the default exception handling behavior. - Approach 1 - Use DRF's default exceptions, with very little modifications. - Approach 2 - HackSoft's proposed way - More ideas - Testing - Overview - Naming conventions - Factories - Celery - The basics - Error handling - Configuration - Structure - Periodic Tasks - Beyond - Cookbook - Handling updates with a service - DX (Developer Experience) - mypy / type annotations - Django Styleguide in the Wild - Additional resources / Alternatives - Inspiration How to ask a question or propose something? Few points to navigate yourself: 1. If you've read the Django Styleguide & you have questions or suggestions, the simplest thing you can is to open an issue. We will respond. 1. Even if you have a question that you are not sure if it's related to the Django Styleguide - just open an issue anyway. We will respond. 1. If you want to see a code example, make sure to head to the Django Styleguide Example repository. We treat this as a "Django test project", combining best practices & also examples from our blog. That's about it ✨ What is this? Hello 👋 This is the Django Styleguide, created by us, the folks at HackSoft. Few important notes about it: 1. It's derived from many years of experience & many Django projects, both big & small. 1. It's pragmatic. All things mentioned here are things tested in production. 1. It's opinionated. This is how we build applications with Django. 1. It's not the only way. There are other ways of building & structuring Django projects that can do the job for you. 1. We have a Django-Styleguide-Example to show most of the styleguide in an actual project. You can watch Radoslav Georgiev's Django structure for scale and longevity for the philosophy behind the styleguide: You can also watch Radoslav Georgiev & Ivaylo Bachvarov's discussi