How to install Python 3.10 in Miniconda
conda create --name threeten --no-default-packages python=3.10
conda activate threeten
How to install Python 3.10 in Miniconda
conda create --name threeten --no-default-packages python=3.10
conda activate threeten
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
| apt-get update | |
| apt-get upgrade | |
| apt install git python3-pip | |
| update-alternatives --install /usr/bin/python python /usr/bin/python3 2 | |
| pip3 install ansible |
| import sys | |
| import xml.etree.cElementTree as et | |
| from io import BytesIO | |
| from django.core.exceptions import ValidationError | |
| from django.core.validators import ( | |
| FileExtensionValidator, | |
| get_available_image_extensions, | |
| ) | |
| from django.forms import ImageField as DjangoImageField |
| if DEBUG: | |
| EMAIL_HOST = 'localhost' | |
| EMAIL_PORT = 1025 | |
| EMAIL_HOST_USER = '' | |
| EMAIL_HOST_PASSWORD = '' | |
| EMAIL_USE_TLS = False | |
| DEFAULT_FROM_EMAIL = 'testing@example.com' |
$ python manage.py makemigrations --empty myApp
operations = [
migrations.RenameField('MyModel', 'old_field_name', 'new_field_name'),
]
Шаг 1: отредактируйте соответствующие имена полей в models.py
class Bar(models.Model):
name = models.CharField(unique=True, max_length=32)
description = models.TextField(null=True, blank=True)
class AnotherModel(models.Model):
bar = models.ForeignKey(Bar) # <-- changed field name
is_awesome = models.BooleanField()
| FROM nginx:alpine | |
| # stock verison from php:alpine image | |
| # ensure www-data user exists | |
| RUN set -x \ | |
| && addgroup -g 82 -S www-data \ | |
| && adduser -u 82 -D -S -G www-data www-data | |
| # 82 is the standard uid/gid for "www-data" in Alpine | |
| # http://git.alpinelinux.org/cgit/aports/tree/main/apache2/apache2.pre-install?h=v3.3.2 |