Open darth-dodo opened 6 years ago
Links from PR
http://stackoverflow.com/questions/29332056/global-error-handler-for-any-exception
http://opensource.com/article/17/3/python-flask-exceptions
http://rock-it.pl/custom-exception-handler-in-django
http://medium.com/@mwhitt.w/restful-error-messages-with-django-537047892dff
Another way would be all
if using Class based views, it should inherit from a base class which in turn is inheriting different classes which handle things such as logging, exception handling, common errors (record does not exist) and handles them efficiently in the parent class.
in function based views, create and stack decorator for the same (wrap the function) http://stackoverflow.com/questions/739654/how-to-make-a-chain-of-function-decorators#1594484
stay away from database triggers
sql = triggers http://softwareengineering.stackexchange.com/questions/123074/sql-triggers-and-when-or-when-not-to-use-them
Django = signals http://lincolnloop.com/blog/django-anti-patterns-signals
Rails = callbacks http://medium.com/planet-arkency/the-biggest-rails-code-smell-you-should-avoid-to-keep-your-app-healthy-a61fd75ab2d3
http://realpython.com/asynchronous-tasks-with-django-and-celery http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html http://wiki.archlinux.org/index.php/Rabbitmq http://docs.celeryproject.org/en/latest/getting-started/brokers/rabbitmq.html
doghi Pagination visarle -__-
http://flask.pocoo.org/snippets/44/ http://flask-sqlalchemy.pocoo.org/2.3/api/
@darth-dodo pagination - (wrong) developer assumption: ek din mai kar kar ke kitna tasks karega. :P
adding a wrapper of config.json/config.yml over virtualenv.
Use case, every time I change env variables, i need to change
vi $VIRTUAL_ENV/bin/postactivate
and vi $VIRTUAL_ENV/bin/predeactivate
,
By using this, I just keep my config separate from my env yet, export in via my env just by adding this to the postactivate
file
export MYSITE_CONFIG="/Users/shabeer/.configs/mysite_config.json"
An extremely novel way of using django models. I will try this out soon. Makes DRY go to the next level. Please do check this out. Pretty extreme for production however very insightful
https://github.com/PokeAPI/pokeapi/blob/master/pokemon_v2/models.py
Backend for self hosting a google photos clone with facial recognition
Amazing mini project. Can be over in 2 days dev, 1 day test cases, 1 day devops + logging (sentry/airbrake)
the entire blog is pretty stellar for an India company
P. S. they recently got funded by Google
https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world