Skip to content

Django #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
raunak-r opened this issue Apr 18, 2020 · 12 comments
Open

Django #10

raunak-r opened this issue Apr 18, 2020 · 12 comments

Comments

@raunak-r
Copy link
Owner

raunak-r commented Apr 18, 2020

@raunak-r
Copy link
Owner Author

raunak-r commented Apr 18, 2020

Working with Data in Django

Django ORM

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

@raunak-r
Copy link
Owner Author

raunak-r commented Apr 18, 2020

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

  • 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

Scaling Celery

-Using seperate queues - https://blog.codeparrot.ai/how-we-scaled-celery-for-our-django-app-da2465a3a6be

@raunak-r
Copy link
Owner Author

raunak-r commented Apr 26, 2020

@raunak-r
Copy link
Owner Author

raunak-r commented Sep 4, 2020

Django - Angular Serving as a Single Page

Checklist

  1. Packages
  2. Middleware
    GETTING THE PATH FROM ANGULAR.JSON projects.architect.build.options.
  3. STATICFILES_STORAGE = 'spa.storage.SPAStaticFilesStorage'
    STATIC_URL, STATIC_ROOT, FRONTEND_APP_DIR
  4. STATICFILES_DIRS = [ (os.path.join(ANGULAR_APP_DIR)), ]
  5. Add URL

@raunak-r
Copy link
Owner Author

raunak-r commented Sep 7, 2020

Django - CORS | CSRF | HTTPS

@raunak-r
Copy link
Owner Author

raunak-r commented Oct 25, 2020

Django - Admin

django-admin-cookbook

@raunak-r
Copy link
Owner Author

Cleaning | Efficiency | Maintainability

https://dev.to/djangodoctor/48-of-django-projects-could-simplify-models-py-in-these-3-ways-1anc?fbclid=IwAR3FCAm-r4Ksg0yDa8RNEgu7PLRH22hH2bolktZochtt_x2BNcDKE1Fw150

@raunak-r
Copy link
Owner Author

raunak-r commented Feb 9, 2021

@raunak-r raunak-r added framework and removed angular labels Apr 6, 2021
@raunak-r
Copy link
Owner Author

@raunak-r
Copy link
Owner Author

Metrics

@raunak-r
Copy link
Owner Author

Socket Programming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant