Open in app

Sign In

Write

Sign In

Andy J. Arciniega
Andy J. Arciniega

4 Followers

Home

About

Jul 8, 2021

How To Access Environment Variables With Python

When you are programming in most cases you need to have privacy with some variables, be it the database variables such as user, password, host etc. These are variables that have sensitive data that you usually need to store in an .env, example: # File .env # DATABASE DB_NAME=... DB_USER=... DB_PASSWORD=... DB_HOST=... How do I get these values? Easily, There is a third-party module that makes life much easier for us, such as: https://pypi.org/project/python-decouple/

Django

1 min read

Django

1 min read


Jul 8, 2021

FastAPI Upload and Save Images

This time I’m going to upload the images locally First of all, it need a library call FastAPI pip install fastapi then what I do is create an ‘app’ object with which I will later create my routes. app = FastAPI() Finally we create our route called ‘/ files’ in which we accept bytes (the bytes of the images) and then what I do is create an image with those bytes received locally and I send a response with the message ‘got it’ to users.

Fastapi

1 min read

Fastapi

1 min read


Jul 8, 2021

Django Overwrite User Model

Do you want to learn how to overwrite the user model in django? Welcome to the best play to learn it. We need to do this before executing any command that affects our database because if we do it later it will place an error. First step, create a new app with a common command: django-admin startproject user then add two lines on your settings.py. # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles',

Django

1 min read

Django

1 min read


Jul 8, 2021

Run One Python Script With Another

How i can do this? Well, just need a function call exec, this is native from python. Basically, just need to read the file that you want to execute with (with open). first, look for your route then for a file name and once you got it call that function. That simple is to run another script using a python script. Thank you!!!!.

Python

1 min read

Python

1 min read


Jul 8, 2021

Hack Wi-fi (Ethical-Python)

En esta ocasión voy a mostrarle un script hecho python en el cual vamos a utilizar la fuerza bruta para acceder a cualquier wifi, pero primero que todo les voy a enseñar como quedara organizado nuestro proyecto: ► schema.xml: Este archivo se va a utilizar para poder acceder a…

Python

2 min read

Python

2 min read


Jul 7, 2021

Python poetry how to generate a requirements.txt

First of all, you need to know. What is poetry? Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you, as they say in their page. https://python-poetry.org/docs/ How can I generate a requirements.txt from poetry.lock? Well, you just need to write an easy command on your CLI (command-line interface).

Poetry

1 min read

Poetry

1 min read

Andy J. Arciniega

Andy J. Arciniega

4 Followers

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech