Creating Custom Django Model Managers

In the most basic setup of a Django project, a request is processed by looping through the Model-View-Controller framework and returns a response. The URL directs the request to the View which handles the logic of how to respond. Usually, the View collects information from the database, inserts that information into a template and display it to the end user.

Django uses Model Managers to define the data to returned from the database. Django's default Model Manager—called objects—performs a query of the project's data and applies a method—called all—that returns a result that provides ...

Continue reading

Sending Email with Flask

The appeal of microframework is the directness of the code written. As opposed to a classic MVC Framework which automatically creates a project folder with several files to be customized before the project is up and running, a microframework can easily exist as a single file.

Using the microframework Flask to automatically sending an email after a triggered event occurs on the website can illustrate the benefits of this approach. Whenever a user signs up to the website or commenting on an article, Flask automatically generates an email to website’s administrator.

By leveraging Flask and plugging in Flask-mail into ...

Continue reading



April 2019
August 2016  




©2019 Cranberryink. All rights reserved.