Skip to the content.

Code 401 Class 34 Reading Notes

Django Settings Best Practices

Managing Django Setting: Issues

Different environments: Usually you have several environments: local, dev, ci, qa, staging, production, etc. Each envirionment can have its won specific settings (for example: DEBUG = True, which will require more verbose logging, additional apps, mocked data, etc.) You need an approach that allows you to keep all these Django setting configurations.

Django setting are a Python code.: These are often in settings.py, it gives flexibility, but also can be a curse and a blessing at the same time.

Setting Configuration: Different Approaches

settings_local.py: Basic idea of this method is to extend all environment specific settings in the settings_local.py file, which is ignored by VCS.

Pros

Cons

Separate settings files for each environment

This an extension of the previous approach. Package the settings with the following structure:

settings/
   ├── __init__.py
   ├── base.py
   ├── ci.py
   ├── local.py
   ├── staging.py
   ├── production.py
   └── qa.py

Pros

Cons

Environment variables

Pros

Cons

Best practices

What is SSH: Understanding Encryption, Ports and Connection

SSH(Secure Shell Protocol): A remote administration protocol that allows users to access, control, and modify their remote servers over the internet.

How Does SSH Work

The SSH command consists of 3 distinct parts:

ssh {user}@{host}

The SSH key command instructs your system that you want to open an encrypted Secure Shell Connection. {user}; represents the acount you want to access. {host}: refers to computer you want to access. Can be IP or domain name.

Gaining an in-depth understanding of the underlying how SSH works can help users understand the security aspects of this technology.

Things I want to know more about

Common practices that hacker try to break these codes and how to avoid them or fortify your code better.

<—BACK