*ARGS.TECH | BLOG | PAGE 4 | Shakhzhakhan Maxudbek's personal blog
Loading...
BLOG


For protecting data in views from anonymous users you need to use authenticating system. Django provides built-in functions for auth implementation (documentation).

What is authentication? Authentication - process of user identification data comparison. Authentication passes in two steps:

- User identification - searching in database entered username.

- Authentication. If username from first step exists, system comparing value from "password" field in HTML page with password, saved in database. Be…


Why exactly Docker compose? Docker compose used when you want to run your applications on any machine and start it by one click. This way called as serverless and cross platform architecture. Docker allow you to run applications on any computer, where it installed. It's very convenient and simple.


Complete structure of project:

demo_project/
    |
    |-- manage.py
    |
    |-- env/
    |
    |-- backend/
    |     |
    |     |-- asgi.py
    |     |-- __init__.py
    |     |-- settings.py
    |     |-- ur…


Django SECRET_KEY need for providing cryptographic signing (documentation). This value is stored in <your_app>/settings.py file. When you start new project it will be generated from built-in function (source code). For production deployment SECRET_KEY must be strong and reliably protected.


These steps help you for generating new SECRET_KEY value:


1. Activate your project's virtual environment:

source env/bin/activate


2. Enter in Django's manage.py shell:

python3 manage.py shell


3. Import get_random_s…

Sending Messages and Files to Users via Telegram Bot API with Python


Introduction


Telegram provides a powerful and simple API for interacting with users via bots. Whether you are building a notification system for your server, a feedback bot, or simply automating daily tasks, the Telegram Bot API is an excellent choice.


You can interact with the API using standard HTTP methods (GET and POST) from any programming language. In this tutorial, we will focus on Python and the requests library to send text messages and files.


Since we will b…


Hardcoding tokens, database credentials and other sensitive data in .py files is not secure. Many people use django-environ library, but I think it inconvenient. So I use yaml files for storing sensitive data and pyyaml library for reading data of them.

Create project folder:

mkdir myproject

Switch in created folder:
cd myproject

Create virtual environment:
python3 -m venv env

Activate virtual environment:
source env/bin/activate

Install Django and pyyaml:
pip3 install django pyyaml

Start new Django proje…
Docker Management Cheat Sheet: Exec, Networking, and Maintenance


Introduction


In my previous article, I covered the absolute basics of downloading and running containers. However, once you start working with Docker daily-especially with stacks like Django and PostgreSQL-you need more tools in your belt.


This cheat sheet covers the essential commands I use for debugging running containers, cleaning up disk space, managing networks, and manually transferring images between servers.


Container lifecycle


While run creates a new c…


If you've worked with Python's requests library to make HTTPS calls, you've almost certainly run into this wall of yellow text in your console:

InsecureRequestWarning: Unverified HTTPS request is being made.

Adding certificate verification is strongly advised.

See: https://urllib3.readthedocs.io/en/latest/advanced-layout.html#ssl-warnings


This warning is common, frequently Googled, and often "f…


After we're figured out the setup cron jobs in operating system, it's time to learn how to run any scripts in Docker container.


Create folder with your project's name and create there four text files with following names:

myproject/
  - my_script.py
  - cronjob
  - Dockerfile
  - docker-compose.yaml

File my_script.py need for run periodically. It may contain any code for your job. For example:
import requests
r = requests.get(url='https://example.com/')
if r.status_code == 200:
    # do something
else:
    …


Допустим тебе надоело работать кассиром в Макдоналдсе, и ты решил ворваться в сферу информационных технологий «с ноги».

Что для этого нужно:
- Усидчивость;
- Терпение;
- Умение пользоваться «Гуглом»;
- Убрать в сторону всякие «не хочу», «не буду».

Что нужно изучать? Все советуют выбрать направление и начинать учиться по нему. Я же скажу что, независимо от выбранного направления, ты должен изучить «базу». Иначе ты становишься хирургом, не знающим анатомию! Не важно, будешь ты инженером по аппаратному …


- Configuring Cisco firewall in Linux machine with Minicom

-> Configuring network access with Cisco ASA via minicom utility


Configuring Cisco ASA 5500-series as network gateway and share internet access to users through local area network (LAN) with DHCP and DNS.


CIsco devices have three mode in command line interface:

- First mode after you connected to device is unprivileged mode. This mode allows only monitoring and you can't modify running configurations.

- Second mode - privileged, allows chan…

Top button