update README
This commit is contained in:
182
Readme.md
182
Readme.md
@@ -1,70 +1,152 @@
|
|||||||
##Fet 2020 Django Project
|
# Fet 2020 Django Project
|
||||||
|
|
||||||
Diese Webseite ist im Jahr 2020 entwickelt worden. Wir haben dazu einige Designentscheidungen getroffen:
|
Diese Webseite ist im Jahr 2020 entwickelt worden. Wir haben dazu einige Designentscheidungen getroffen:
|
||||||
1. Zunächst auf die externen Kernfunktionen fokusieren
|
|
||||||
2. Python+Django nutzen weil:
|
1. Zunächst auf die externen Kernfunktionen fokussieren
|
||||||
* Wir Python mögen
|
2. Python + Django nutzen weil:
|
||||||
* Das Framework uns freiheit gibt zB die Mitglieder Daten entsprechend abzubilden
|
* wir Python mögen
|
||||||
* Das Design unabhängig von der Funktion bleibt
|
* das Framework uns die Freiheit gibt, zB die Mitglieder Daten entsprechend abzubilden
|
||||||
|
* das Design unabhängig von der Funktion bleibt
|
||||||
* und einiges mehr
|
* und einiges mehr
|
||||||
3. Als Kernfunktionen festgelegt wurden anfangs:
|
3. Als Kernfunktionen festgelegt wurden anfangs:
|
||||||
* Neuigkeiten posten
|
* Neuigkeiten posten
|
||||||
* FET Sitzungen ankündigen
|
* FET Sitzungen ankündigen
|
||||||
* Etherpad für Agenda und Protokoll
|
* Etherpad für Agenda und Protokoll
|
||||||
* Informationen zu Mitgliedern anzeigen
|
* Informationen zu Mitgliedern anzeigen
|
||||||
4. Unter dem Eindruck eines Jahres des Lockdown wurde zusätzlich hinzugefügt
|
4. Unter dem Eindruck eines Jahres des Lockdown wurde zusätzlich hinzugefügt
|
||||||
* Ein virtuelles Schwarzesbrett
|
* Ein virtuelles Schwarzesbrett
|
||||||
* Eine virtuelle Aufgabenliste
|
|
||||||
|
|
||||||
### Ablage und Entwicklung
|
## Development
|
||||||
Der Master liegt auf dem virtuellen git Server und kann wie folgt geholt werden:
|
|
||||||
|
The main branch is hosted on the FET git server. Clone the repository using the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://git.fet.at/bofh/fet2020
|
git clone https://git.fet.at/bofh/fet2020
|
||||||
```
|
```
|
||||||
### Deployment
|
|
||||||
|
|
||||||
{{docker-compose.yml}}
|
## Debug
|
||||||
<code>
|
|
||||||
docker-compose up
|
|
||||||
</code>
|
|
||||||
|
|
||||||
### Command Befehle
|
If you are developing on Windows, install Visual Studio Code and Docker Desktop.
|
||||||
|
|
||||||
Erstellt alle Searchindexes neu:
|
Add a local user/member for login because the project is not connected to FET LDAP in dev mode:
|
||||||
<code>
|
|
||||||
|
```bash
|
||||||
|
python manage.py createsuperuser
|
||||||
|
```
|
||||||
|
|
||||||
|
### Python version
|
||||||
|
|
||||||
|
View all python versions:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uv python list
|
||||||
|
```
|
||||||
|
|
||||||
|
Installing Python executables:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uv python install $(.python-version) --default
|
||||||
|
```
|
||||||
|
|
||||||
|
Update the following files if the python version is increased:
|
||||||
|
|
||||||
|
* .python-version
|
||||||
|
* pyproject.toml
|
||||||
|
* run-pre-commit.sh
|
||||||
|
|
||||||
|
## Deployment
|
||||||
|
|
||||||
|
### Docker image for django
|
||||||
|
|
||||||
|
Makemigrations:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python fet2020/manage.py makemigrations blackboard core finance gallery members posts rental
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python fet2020/manage.py makemigrations intern
|
||||||
|
```
|
||||||
|
|
||||||
|
Add all static files to the assets:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python fet2020/manage.py collectstatic
|
||||||
|
```
|
||||||
|
|
||||||
|
Check if the project is for deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python fet2020/manage.py check --deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
Build the docker image of django project:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build -t django-image -f fet2020/Dockerfile ./fet2020
|
||||||
|
```
|
||||||
|
|
||||||
|
### Docker image for nginx
|
||||||
|
|
||||||
|
Build the docker image of nginx:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build -t django-nginx-image -f nginx/Dockerfile ./nginx
|
||||||
|
```
|
||||||
|
|
||||||
|
### Start docker container
|
||||||
|
|
||||||
|
Build the docker containers:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f docker-compose.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
Remove all unused docker images older than 24 hours:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker image prune -a --filter "until=24h"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Other Useful Commands
|
||||||
|
|
||||||
|
Please use the command carefully! Remove all unused docker volumes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker volume prune -a
|
||||||
|
```
|
||||||
|
|
||||||
|
Rebuilds all search indexes:
|
||||||
|
|
||||||
|
```bash
|
||||||
python3 fet2020/manage.py rebuild_index
|
python3 fet2020/manage.py rebuild_index
|
||||||
</code>
|
```
|
||||||
|
|
||||||
Aktualisiert alle Searchindexes:
|
Updates all search indexes:
|
||||||
<code>
|
|
||||||
|
```bash
|
||||||
python3 fet2020/manage.py update_index
|
python3 fet2020/manage.py update_index
|
||||||
</code>
|
|
||||||
|
|
||||||
Fügt alle Cronjobs in diesem Projekt hinzu:
|
|
||||||
<code>
|
|
||||||
python3 fet2020/manage.py crontab add
|
|
||||||
</code>
|
|
||||||
|
|
||||||
Fügt alle Staticfiles in die Assets hinzu:
|
|
||||||
<code>
|
|
||||||
python3 fet2020/manage.py collectstatic
|
|
||||||
</code>
|
|
||||||
|
|
||||||
Überprüft, ob die Software bereit für die Produktion ist.
|
|
||||||
<code>
|
|
||||||
python3 fet2020/manage.py check --deploy
|
|
||||||
</code>
|
|
||||||
|
|
||||||
Code Formatting (zuerst isort und danach black anwenden):
|
|
||||||
```bash
|
|
||||||
isort **/*.py
|
|
||||||
```
|
|
||||||
```bash
|
|
||||||
black **/*.py
|
|
||||||
```
|
|
||||||
```bash
|
|
||||||
isort **/templatetags/*.py
|
|
||||||
```
|
|
||||||
```bash
|
|
||||||
black **/templatetags/*.py
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
ckeditor -> django-prose-editor
|
||||||
|
|
||||||
|
## Version History
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
* Add rental
|
||||||
|
|
||||||
|
2.1.0
|
||||||
|
|
||||||
|
* Add finance system
|
||||||
|
|
||||||
|
2.0.0
|
||||||
|
|
||||||
|
* Update the homepage design
|
||||||
|
* Add intern
|
||||||
|
|
||||||
|
1.0.0
|
||||||
|
|
||||||
|
* First release of the new homepage
|
||||||
|
|||||||
Reference in New Issue
Block a user