Why is it used -u
when making a git push -u origin main
, since apparently doing a push with or without it does the same thing.
I'm learning to use Gitlab CI and trying to configure the file .gitlab-ci
to run in my Django project.
- I have the following file
.gitlab-ci
(it is an example, it is not complete):
stages:
- test
variables:
MYSQL_DATABASE: $DB_NAME
MYSQL_USER: $DB_USER
MYSQL_PASSWORD: $DB_PASSWORD
services:
- mysql:8.0
test:
image: alpine:3.13
stage: test
script:
- ...(up the app)...
- I have set environment variables in Gitlab (Settings -> CI/CD -> Variables), eg:
- And I have the following configuration in the file
settings.py
with the DB section:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': getenv('DB_NAME'),
'USER': getenv('DB_USER'),
'PASSWORD': getenv('DB_PASSWORD'),
'HOST': getenv('DB_HOST'),
'PORT': getenv('DB_PORT'),
'TEST' : {
'NAME' : f"test_{getenv('DB_NAME')}",
}
}
}
When it runs, everything installs correctly but when it gets to the section of running the django tests it throws the following error:
django.db.utils.OperationalError: (2005, "Unknown MySQL server host 'mysql' (-2)")
Why doesn't it connect if the Gitlab documentation indicates that it can be used mysql
as a DB host?
For example, I do not understand the concept that PUT should be used to update and not POST, when sending a form from html with its values, once these values are received in the backend, what is done is to write the code in PHP for example , to communicate with the database and make the query to Update a specific record, regardless of whether the method was PUT, POST or GET.
What is really the difference between using one or the other?
Many times one is programming in C , and comes across the segmentation fault message , what does it mean and why does it occur?
How do you go about displaying a Rails view without displaying the app layout for a logged in user and another layout for a visitor? It can?