Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update docs, README
  • Loading branch information
Merlin Buczek committed Sep 25, 2019
1 parent f580c00 commit 5707f31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 38 deletions.
35 changes: 1 addition & 34 deletions README.md
Expand Up @@ -42,37 +42,4 @@ See [django-auth-ldap docs](https://django-auth-ldap.readthedocs.io/en/latest/au
- `python manage.py collectstatic`. See [Django docs](https://docs.djangoproject.com/en/2.2/ref/contrib/staticfiles/#collectstatic)

# Deployment with Apache and mod_wsgi
For details see [Django docs](https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/).

## Example configuration
```
# Load wsgi module
LoadModule wsgi_module modules/mod_wsgi.so
Alias /media/ /path/to/mpicms/mpicms/media/
Alias /static/ /path/to/mpicms/staticfiles/
# Static files should be access seperately
<Directory /path/to/mpicms/staticfiles>
Require all granted
</Directory>
<Directory /path/to/mpicms/mpicms/media>
Require all granted
</Directory>
WSGIPythonHome /path/to/venv
WSGIScriptAlias / /path/to/mpicms/config/wsgi.py
<Directory /path/to/mpicms/config>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
```

# LDAP population
To populate the database with an existing LDAP user, run `django_auth_ldap.backend.LDAPBackend.populate_user()`. See [django-auth-ldap docs](https://django-auth-ldap.readthedocs.io/en/latest/users.html#updating-users) for details.

# Python shell
Access with `python manage.py shell --settings=config.settings.production`.
See [Django docs](https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/).
17 changes: 13 additions & 4 deletions docs/developer_information/dev_notes.md
@@ -1,14 +1,23 @@
# Development Notes

## LDAP population
To populate the database with an existing LDAP user, run `django_auth_ldap.backend.LDAPBackend.populate_user()`. See [django-auth-ldap docs](https://django-auth-ldap.readthedocs.io/en/latest/users.html#updating-users) for details.

## Python shell
Access with `python manage.py shell --settings=config.settings.production`.

## Search Index
After objects have been created through a script, `manage.py update_index` sould be run. See [Wagtail docs](https://docs.wagtail.io/en/latest/topics/search/indexing.html#the-update-index-command).

## Translation
In `urls.py`, `i18n_patterns()` can be passed `prefix_default_language=False`. This disables the language url prefix for the default language, but results in breaking Django's `set_language` view (used by language selection dropdown), as it is not able to get the current url without language prefix. This could be solved by passing the redirect location as POST parameter `next`, and would require to write a hacky solution to remove the language prefix, if it exists.

Individual StreamField blocks are not translateable yet, see [this issue](https://github.com/infoportugal/wagtail-modeltranslation/issues/82).

Empty fields (excluding StreamFields) are automatically populated with the the default langugage content due to [this issue](https://github.com/infoportugal/wagtail-modeltranslation/issues/247).

## Imports
Django lets you import `<app_label>`, which will result in errors later. Only import `mpicms.<app_label>`, as specified in the app configs.
### Updating translations
Run `python manage.py makemessages --ignore=users` to generate an updated `.po` file in `locale/de/LC_MESSAGES`. After editing the file, run `python manage.py compilemessages` to compile the new translations. See [Django docs](https://docs.djangoproject.com/en/2.2/topics/i18n/translation/) for details.

## Search Index
After objects have been created through a script, `manage.py update_index` sould be run. See [Wagtail docs](https://docs.wagtail.io/en/latest/topics/search/indexing.html#the-update-index-command).
## Imports
Django lets you import `<app_label>`, which will result in errors later. Only import `mpicms.<app_label>`, as specified in the app configs.

0 comments on commit 5707f31

Please sign in to comment.