Hi! I'm Juan David Hernández
(KISS)
“Simplicity is the ultimate sophistication”
~ Leonardo Da vinci
Put more logic into anything but views and templates
Examine all possibilities offered by the framework before using alternatives
It’s a way of doing things designed to help us put together maintainable projects in a reasonable amount of time.
code written in a clear, consistent style
PEP 8 coding conventions: http://www.python.org/dev/peps/pep-0008/
On open source projects
On private projects
PEP 8 suggests that imports should be grouped in the following order:
Standard library imports
Related third-party imports
Local application or library specific imports
The import order in a Django project is :
Example
Bad Example
use "From __future__ import absolute_import "
Here are some of the issues encountered:
They are the de facto standard for Django projects
Tool to install python packages
Tool for creating isolated Python environments for maintaining package dependencies
README.rst
docs/
.gitignore
requirements.txt
Project Django
Directory
Directories
.py
settings.py
url.py
“The art of creating and maintaining a good Django app is that it should follow the truncated Unix philosophy according to Douglas McIlroy: ‘Write programs that do one thing and do it well.”
~ James Bennett
When possible keep to single word names
A good, obvious app name makes the project easier to maintain.
As a general rule, the app’s name should be a plural version of the app’s main model
The apps layout is an art, not a science
Try to keep as small as possible apps
It’s better to have many small apps than to have a few giant apps.
Use environment variables
To see how you access environment variables from the Python side
To access environment variables from one of your settings
It’s good practice for each settings file to have its own corresponding requirements file
$ pip install -r requeriments/local.txt
No muy corchadoras.....