Kass Kodes's Avatar

Kass Kodes

@kasskodes.bsky.social

i'm trying to "put myself out there" so i'm on bsky sharing what I learn as a dev

4 Followers  |  3 Following  |  4 Posts  |  Joined: 16.12.2024  |  1.594

Latest posts by kasskodes.bsky.social on Bluesky

goal: render a home.html page using Django. Set up: make sure you have python installed then: `mkdir some-folder-name` some place to store your project, `virtualenv env` create a virtual environment, `source env/bin/activate` activate the virutal env. 1: start a django project. `pip install django` `django-admin startproject demo` This django project is generated. A project in Django is the overarching framework that contains the configuration and settings for an entire web application.

goal: render a home.html page using Django. Set up: make sure you have python installed then: `mkdir some-folder-name` some place to store your project, `virtualenv env` create a virtual environment, `source env/bin/activate` activate the virutal env. 1: start a django project. `pip install django` `django-admin startproject demo` This django project is generated. A project in Django is the overarching framework that contains the configuration and settings for an entire web application.

2: understanding a django project. `__init__.py` Makes the directory "demo" a Python package, allowing it to be imported as a module .
Helps Django recognize + manage the project as a package. `settings.py`  Makes the directory "demo" a Python package, allowing it to be imported as a module .
Helps Django recognize + manage the project as a package. `urls.py` Defines the root URL configuration for the project. 
Directs incoming requests to the appropriate app-level "urls.py" files or views, acting as the central URL dispatcher for the project. `manage.py` A command-line utility for managing your Django project. 
Allows you to run commands like starting the server, applying migrations, and creating apps. 
Works as a wrapper around `django-admin` and ensures the correct settings are used. `asgi.py` and `wsgi.py` allow django to communicate with the web server using the ASGI or WSGI protocols.

2: understanding a django project. `__init__.py` Makes the directory "demo" a Python package, allowing it to be imported as a module . Helps Django recognize + manage the project as a package. `settings.py` Makes the directory "demo" a Python package, allowing it to be imported as a module . Helps Django recognize + manage the project as a package. `urls.py` Defines the root URL configuration for the project. Directs incoming requests to the appropriate app-level "urls.py" files or views, acting as the central URL dispatcher for the project. `manage.py` A command-line utility for managing your Django project. Allows you to run commands like starting the server, applying migrations, and creating apps. Works as a wrapper around `django-admin` and ensures the correct settings are used. `asgi.py` and `wsgi.py` allow django to communicate with the web server using the ASGI or WSGI protocols.

I keep forgetting about you, bsky-- but not today!

The question of today: what files get generated when I run the command `django-admin startproject projectname`? And why are they there?

21.02.2025 20:36 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Full diagram of software testing pyramid denotes unit tests at the base in orange, integration tests in the middle in blue, and end to end testing at the top in purple. Certain aspects differ for these different levels of testing and are denoted by changes in color as well as arrows.

Full diagram of software testing pyramid denotes unit tests at the base in orange, integration tests in the middle in blue, and end to end testing at the top in purple. Certain aspects differ for these different levels of testing and are denoted by changes in color as well as arrows.

Unit tests have isolated coverage, individual function or method scope, fine grained granularity, and no dependencies. E2E test have broader coverage as they scope the entire application workflow, have complex granularity due to the scope and have the most amount of dependencies. Integration tests fall somewhere in the middle.

Unit tests have isolated coverage, individual function or method scope, fine grained granularity, and no dependencies. E2E test have broader coverage as they scope the entire application workflow, have complex granularity due to the scope and have the most amount of dependencies. Integration tests fall somewhere in the middle.

Image shows unit tests having these aspects: lower cost, faster speed, more tests, and some testing tools used. E2E testing is more expensive, slower to run, usually have less tests, and some tools are listed.

Image shows unit tests having these aspects: lower cost, faster speed, more tests, and some testing tools used. E2E testing is more expensive, slower to run, usually have less tests, and some tools are listed.

Question: Software testing pyramid? Why do I care?

So we don't waste our time and energy writing tests "willy nilly" because we don't know the differences between unit, integration, and E2E tests

and to help prevent, "oh no... I pushed my code up and now something in main is broken" πŸ™πŸ»

pics below!

08.01.2025 20:23 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
full overview showing definition of useEffect as well as some examples of when to use a handler vs a useeffect

full overview showing definition of useEffect as well as some examples of when to use a handler vs a useeffect

function definition of useeffect

function definition of useeffect

handler vs function. 1st ask yourself this question, why does this code need to run. useeffect: code that should run because the component was displayed to the user. handler : code that runs in response to specific interactions

handler vs function. 1st ask yourself this question, why does this code need to run. useeffect: code that should run because the component was displayed to the user. handler : code that runs in response to specific interactions

examples of when to use effects vs handlers and why

examples of when to use effects vs handlers and why

Another question: When is the best time to use a "useEffect" hook?

useEffects are best for running some code after rendering to sync your component with some system outside of react.

Turns out: you might not need a useEffect in your code!

Pics are a brain dump of what I learned

19.12.2024 15:56 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
full overview

full overview

full table scan results in iterating through each row until we find what we are looking for

full table scan results in iterating through each row until we find what we are looking for

indexing overview shows that a new data structure is created to store information about tables

indexing overview shows that a new data structure is created to store information about tables

same query with index results in less operations

same query with index results in less operations

I ask a lot of questions. Here is one today.

What is an index in a relational database?

The db creates a data structure (like a hash structure or b-tree) on indexed column(s). It stores values and pointers to table rows.

I made a visual to show a full table scan vs indexing :p

17.12.2024 19:52 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@kasskodes is following 3 prominent accounts