全文検索:
- 2023.12.14 React-adminとDjangoの連携 @50_dialy:2023:12
- b import models class Product(models.Model): name = models.CharField(max_length=200) price = mo... ield() def __str__(self): return self.name </code> === マイグレーションファイル作成 === $ docker-comp... s = [ migrations.CreateModel( name='Product', fields=[ (... =True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField
- 2023.06.03 Django アプリ追加 @50_dialy:2023:06
- (level=logging.INFO) logger = logging.getLogger(__name__) class View(TemplateView): template_name = "test.html" def get(self, request): cont... return render(self.request, self.template_name, context) def post(self, request): co... on': request.POST.get('action'), 'name1': request.POST.get('name1'), 'na
- 16 共用サーバで、pythonインストール @15_python
- 2023.07.31現在: さくらレンタルサーバの環境はFreeBSD13 <code> $ uname -a FreeBSD www1564.sakura.ne.jp 13.0-RELEASE-p12 ... ccess> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /hello/index.cgi/$1 [QSA,... : utf-8 -*- from flask import Flask app = Flask(__name__) @app.route('/') def index(): return "Hello World!\n" if __name__ == '__main__': app.run() </code> <code|in
- 31 Docker FTP Server @06_virtualization:05_container
- ent: PUBLICHOST: "localhost" FTP_USER_NAME: username FTP_USER_PASS: mypass FTP_USER_HOME: /home/username ↓ environment: PUBLICHOST: "[HOSTNAME]" FTP_USER_NAME: [USER] FTP_USER_PASS:
- 07 Python Selenium @15_python
- tc/yum.repos.d/google.chrome.repo [google-chrome] name=google-chrome baseurl=http://dl.google.com/linux/... de> # ID/PASSを入力して、ボタンクリック driver.find_element_by_name("USERID").clear() driver.find_element_by_name("USERID").send_keys("hoge") driver.find_element_by_name("PASSWORD").clear() driver.find_element_by_name("
- 2024.04.12 MySQL bitフィールド @50_dialy:2024:04
- t(11) | NO | PRI | NULL | auto_increment | | name | text | YES | | NULL | ... rows in set (0.00 sec) mysql> insert into test (name,enabled) VALUES('AAA',b'1'); Query OK, 1 row affected (0.01 sec) mysql> insert into test (name,enabled) VALUES('BBB',b'0'); Query OK, 1 row affe... elect * from test; +----+------+---------+ | id | name | enabled | +----+------+---------+ | 1 | AAA |
- 2024.04.12 MySQL BIT Field @en:50_dialy:2024:04
- t(11) | NO | PRI | NULL | auto_increment | | name | text | YES | | NULL | ... 3 rows in set (0.00 sec) mysql> insert into test (name,enabled) VALUES('AAA',b'1'); Query OK, 1 row affected (0.01 sec) mysql> insert into test (name,enabled) VALUES('BBB',b'0'); Query OK, 1 row affe... elect * from test; +----+------+---------+ | id | name | enabled | +----+------+---------+ | 1 | AAA | |
- 27 Docker Djnago @06_virtualization:05_container
- yml> version: '3' services: django: container_name: "django" build: . command: python3 manage.... - CHOKIDAR_USEPOLLING=true db: container_name: "db" image: mysql:8.0 restart: always e... yml> version: '3' services: django: container_name: "django" build: . command: python3 manage.... - app_proxy-tier - default db: container_name: "db" image: mysql:8.0 restart: always e
- 25 Let's Encrypt リバースプロキシ @06_virtualization:05_container
- mage: nginxproxy/nginx-proxy:alpine container_name: proxy restart: always ports: - 80:... image: nginxproxy/acme-companion container_name: letsencrypt restart: always volumes: ... トワークを確認 <code> # docker network ls NETWORK ID NAME DRIVER SCOPE da005313961c app_pr... s: nginx: image: nginx:latest container_name: nginx ports: - "8080:80" volumes:
- 30 React-admin @06_virtualization:05_container
- ml> version: '3' services: node: container_name: "react" build: . volumes: - .:/usr... ml> version: '3' services: node: container_name: "react" build: . volumes: - .:/usr... , and validate with Enter: ❯ Hard coded local username/password Hard coded local username/password None No authProvider ↓ How do you want to install
- 09 SSH in While @en:bash
- is will display only one line. <code> while read NAME HOST CMD do ssh $NAME@$HOST "$CMD" done </code> When you run SSH, stdin is directed at it, so the en... t stdin. ===== OK here ===== <code> while read NAME HOST CMD do ssh -n $NAME@$HOST "$CMD" done </code> {{tag>bash ssh while}}
- 2022.10.01 Nextcloud @50_dialy:2022:10
- atsui@gmogshd.com # - SSL_KEY=/certs/servhostname.local.key # - SSL_CSR=/certs/servhostname.local.csr # - SSL_CERT=/certs/servhostname.local.crt # networks: # - proxy-tier volumes: ... XXXXXXXXXXXXXXXX', // Secret access key: 'hostname' => 's3.hoghoge.com', //オブジェクトストレージのホスト名 'por
- 04 Docker MailServer @06_virtualization:05_container
- mailserver/docker-mailserver:latest container_name: mailserver # Provide the FQDN of your mail s... DNS MX record should point to this value) hostname: mail.hogehoge.com env_file: mailserver.env ... lserver sa-learn --spam /var/mail/example.com/username/.Junk --dbpath /var/mail-state/lib-amavis/.spamas
- 10 Docker Let's Encrypt @06_virtualization:05_container
- tc/nginx/conf.d/default.conf> server { server_name example.com; listen 80; listen [::]:80; ... == NginxでSSL有効化 ===== <code> server { server_name example.com; listen 80; listen [::]:80; ... root /var/www/html; } } server { server_name example.com; listen 443 ssl http2; list
- 2024.04.17 WSL2 ディストリビューション削除 @50_dialy:2024:04
- 84 を削除してみる。 <code> C:\Users\s-matsui>wsl -l -v NAME STATE VERSION * Ubunt... 除。 この操作を正しく終了しました。 C:\Users\s-matsui>wsl -l -v NAME STATE VERSION * Ubunt... 除。 この操作を正しく終了しました。 C:\Users\s-matsui>wsl -l -v NAME STATE VERSION * Ubunt