[damned-lies.wiki] Create Deploy Damned Lies
- From: Guillaume Bernard <gbernard src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies.wiki] Create Deploy Damned Lies
- Date: Tue, 6 Sep 2022 07:28:22 +0000 (UTC)
commit a14d7894f8a1da2f3a100b09fff0f3ac888afd1f
Author: Guillaume Bernard <associations guillaume-bernard fr>
Date: Tue Sep 6 07:28:21 2022 +0000
Create Deploy Damned Lies
Deploy-Damned-Lies.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
---
diff --git a/Deploy-Damned-Lies.md b/Deploy-Damned-Lies.md
new file mode 100644
index 0000000..529d3c1
--- /dev/null
+++ b/Deploy-Damned-Lies.md
@@ -0,0 +1,52 @@
+## Maintenance tasks
+
+There is a management command to run maintenance tasks (clean never-activated accounts, inactivate unused
roles, …):
+
+```bash
+./manage.py run-maintenance
+```
+
+Note: it might be useful to add the command in a cron schedule.
+
+<!-- This should be moved to a documentation instead of remaining in the README file -->
+
+## Databases
+
+It’s important to use the Unix Domain Socket connection to obtain good performances.
+
+### PostgreSQL
+
+In the `DATABASES['default']` dictionary, you just need to define `ENGINE = 'django.db.backends.postgresql'`
+and the `NAME` key. Leave the `HOST` setting empty to use `UDS`.
+
+### MySQL
+
+Create a database in UTF8, either with `default-character-set = utf8` under `[mysqld]` section in the
`my.cnf` file or
+with an explicit SQL instruction:
+
+```sql
+CREATE
+DATABASE <DATABASE_NAME> charset=utf8;
+```
+
+Then, you have to update your `damnedlies/local_settings.py`:
+
+```python
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.mysql',
+ 'NAME': '<your database name>',
+ 'USER': '<your user>',
+ 'PASSWORD': '<your password>',
+ 'HOST': '/var/run/mysqld/mysqld.sock',
+ 'OPTIONS': {
+ 'read_default_file': '/etc/mysql/my.cnf',
+ }
+ }
+}
+```
+
+Grep for `ANSI_QUOTES` in the source code to find the `models.py` which use a hack to workaround the double
quotes
+interpretation in MySQL. The best solution is to run the MySQL server with
+the [`ANSI_QUOTES` mode](http://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) (`sql-mode="ANSI_QUOTES"` in
`my.cnf`),
+but it can be damaging for other applications.~~
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]