Description: To set up a virtual env and install django.
Takeaway: It is a good practice to keep separate envs for different projects as one can need different versions of django for different projects. If something goes wrong, it'll be curbed in that specific env.
Description: Create an app and get acquainted with the project structure and the various files used.
Takeaway: Within a module, apps are created to handle various tasks separately. These apps then can be reused.
Description: To create a route that consumes any API and displays the result on the page.
Takeaway: Many APIs are available which makes it easier to gather national or global data.
Description: Send the API results to an email.
Takeaway: It is easy to send mails in django, just need to setup the SMTP host and port and authenticate the SMTP server. Make sure that the email through which you are sending the mail, less secure app access is turned on.
Description: Add a model to your system.
Takeaway: One can use the django-models available or can build custom models according to their needs. Django by default creates a SQLite database where its default models are stored.
Description: Implement Role-Based-Access-Control.
Takeaway: Permissions are tied to the User model from django.contrib.auth, so we cannot use any other model to allow permissions and assign roles to. However, easybrac removes that constraint.
Blocker: Customising using easyrbac was tedious and reference material available was limited hence used django-rbac instead.
Description: Build an API endpoint using Rest framework.
Takeaway: Serializers are used to convert the api data in json format.
Description: Learn about MongoDB.
Takeaway: It is a NoSQL database and can be used when the final structure of your database is not fixed and the fields are likely to be modified.
Description: Use pymongo to connect python with mongodb. And move your models to nosql.
Takeaway:
Blockers: Reference material was available on djongo but was limited for pymongo. Auto-DL's github repo code helped understand how to connect django and mongodb using pymongo.
Description: Learn about unit tests.
Takeaway: Tests should be isolated, tests should not be dependent on other tests. Understood setup, teardowns, coverage, fixtures and other basics concepts of unit testing in python.
Blockers: pytest resources mostly lead to unittesting without the pytest library. 'The Dumbfounds' have explained implementation for pytest and django together.
Description: Learn about the concept of mocking in unit tests.
Takeaway: Mocking is used when you don't actually require to check the final result but have to check whether the intermediate steps such as an api call or request reponse are correct.
Blockers: Understanding the purpose and use of mocking was difficult. Corey Schafer's explanation for unit test and mocking in unit test made it clearer.
Description:
Takeaway:
Description:
Takeaway:
Summer
Training
Book
2021