Comments (12)
Cleaning | Efficiency | Maintainability
from tech-notes.
Working with Data in Django
Django ORM
- https://books.agiliq.com/projects/django-orm-cookbook/en/latest/index.html
- on_delete attribute
- Include & Exclude
Creating Data
Migrations
Using Inbuilt Django Models
Notes
If blank=True then the field will not be required, whereas if it's False the field cannot be blank.
The exception is CharFields and TextFields, which in Django are never saved as NULL. Blank values are stored in the DB as an empty string ('')
CHAR and TEXT types are never saved as NULL by Django, so null=True is unnecessary.
Optimizations
https://medium.com/better-programming/django-select-related-and-prefetch-related-f23043fd635d
from tech-notes.
Integrating Tools with Django
Using Databases
Celery
Short Readme on integrating Redis and Celery with Django - #19 (comment)
List of all files - https://gist.github.com/raunak-r/bdc622e22b985d5b4bb0c15914272596
Flower Integration
- https://flower.readthedocs.io/en/latest/install.html#usage
- https://ordinarycoders.com/blog/article/django-celery-flower
- Flower does not process tasks. You must run both, then Flower can be used as a monitoring tool.
Run celery:
celery -A tasks worker --loglevel=info
Open another shell and run flower:
celery -A tasks flower --loglevel=info
Others
- Celery and RabbitMQ
- https://adamj.eu/tech/2021/01/20/efficient-reloading-in-djangos-runserver-with-watchman/?fbclid=IwAR3gra9VwrQ6kSg7h8WOkr-XV93k1UX9r50ziqkWolN9xWUCrLLbzBYLvVA
Scaling Celery
-Using seperate queues - https://blog.codeparrot.ai/how-we-scaled-celery-for-our-django-app-da2465a3a6be
- Problems with Redis - celery/celery#5935
from tech-notes.
Django ORM Objects
Model Inheritance to create new Models
Foreign Keys
- Multiple Foreign Keys from 1 table to another same table
- (https://stackoverflow.com/questions/583327/django-model-with-2-foreign-keys-from-the-same-table)
from tech-notes.
Django - Angular Serving as a Single Page
-
Middlewares, Storage Location etc - django-spa Documentation
-
Writing the URL
ex . path('', serve, {settings.APP_DIR: 'index.html'})
Checklist
- Packages
- Middleware
GETTING THE PATH FROM ANGULAR.JSON projects.architect.build.options. - STATICFILES_STORAGE = 'spa.storage.SPAStaticFilesStorage'
STATIC_URL, STATIC_ROOT, FRONTEND_APP_DIR - STATICFILES_DIRS = [ (os.path.join(ANGULAR_APP_DIR)), ]
- Add URL
from tech-notes.
Django - CORS | CSRF | HTTPS
-
What is mixed content. http and https mixed in angular websites. - https://www.howtogeek.com/443032/what-is-mixed-content-and-why-is-chrome-blocking-it/
-
mixed content calling http from https angular or vice-versa - https://stackoverflow.com/questions/18321032/how-to-get-chrome-to-allow-mixed-content)
from tech-notes.
Django - Admin
from tech-notes.
Async Django
from tech-notes.
Production | Deployment
- Best Practices - https://www.facebook.com/notes/django-python-web-framework/django-deployment/792337874150794
- Debug False - https://gist.github.com/raunak-r/6d69e2cfdf18b4751397bc38f9c96691
Aws, S3, RDS, CI-CD
Scaling
Scaling Celery
from tech-notes.
Testing
https://vedantsopinions.medium.com/test-driven-development-like-a-boss-e17679a2ed72
from tech-notes.
Metrics
- add a request id to each log line - https://github.com/dabapps/django-log-request-id
from tech-notes.
Socket Programming
- Sending data from BE to FE. https://devarea.com/angular-and-django-websockets-communication/#.X5R1vKlN00N
from tech-notes.
Related Issues (20)
- Web Scraping
- AWS, GCP, Azure | Cloud Security HOT 4
- Ubuntu | WSL HOT 4
- Blog Links - Code | IT | Future HOT 3
- Data Structures | DSA | Interviews HOT 1
- Website | UI/UX | Web Design HOT 5
- Blog Links - Code | IT | Future HOT 5
- IaaS, PaaS, SaaS
- Data Engineering | Kafka | ElasticSearch | ELK | Esper | Nifi HOT 5
- Search and Analytics
- Java | Spring HOT 5
- FileSystem Storages
- Mobile-Dev | Android | iOS
- fastAPI HOT 1
- Microservices Architecture HOT 2
- Scaling a Saas Startup
- Networks HOT 1
- Databases
- Blockchain HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tech-notes.