/udemy-python-django

Udemy Python and Django Full stack Web Developer Bootcamp

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

My Course notes for Udemy - Python and Django Full Stack Web Developer Bootcamp

Link: Python and Django Full Stack Web Developer Bootcamp

» Lecture Notes


Assumptions

  • Python version ~= 3.6

requirements.txt

python -m pip install -r requirements-to-freeze.txt --upgrade
python -m pip freeze > requirements.txt

Super User

./manage.py createsuperuser [username]

Stock Settings additions

Line 13 - imports

import os

Line 18-20 - DIR setups

TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
STATIC_DIR = os.path.join(BASE_DIR, 'static')
MEDIA_DIR = os.path.join(BASE_DIR, 'media')

Line 43 - last line of INSTALLED_APPS - add app name

Line 56 - LOGGING

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    "formatters": {
        "console": {"format": "{asctime} [ {name} :: {module} ] [{levelname}] | {message}", "style": "{"}
    },
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler', 'formatter': 'console',
        },
    },
    'root': {
        'handlers': ['console'],
        'level': 'WARNING',
    },
    'loggers': {
        'basic_app.views': {
            'handlers': ['console'],
            'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
            'propagate': False,
        },
    },
}

Line 85 - TEMPLATES - DIR

        'DIRS': [TEMPLATE_DIR],

Line 136 - TIME_ZONE

TIME_ZONE = 'Africa/Johannesburg'

Completed

🏁 Certificate