You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+70-7Lines changed: 70 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Shiftings
2
2
3
-
This is a simple shift management system. Built and maintained by students from the self-governed student dormatory[HaDiKo](https://www.hadiko.de/).
3
+
This is a simple shift management system. Built and maintained by students from the self-governed student dormitory[HaDiKo](https://www.hadiko.de/).
4
4
5
5
## Description
6
6
@@ -13,21 +13,84 @@ We plan on adding functionality for managing a high density of Shifts in a short
13
13
14
14
## Getting Started
15
15
16
-
### Requirements
16
+
### Development / Local setup
17
17
18
-
* Python >= 3.9
19
-
* Gunicorn or similar WSGI/ASGI Server
18
+
This section describes a quick local setup for development or testing out the software running and getting accessed on a single PC.
20
19
21
-
###Installing
20
+
#### Clone the repository
22
21
23
-
See [django docs](https://docs.djangoproject.com/en/4.1/howto/deployment/) for details on how to deploy a django application.
22
+
Start by cloning the repository and change your working directory to it:
23
+
24
+
```shell
25
+
git clone https://github.com/HaDiNet/shiftings
26
+
cd shiftings
27
+
```
28
+
29
+
#### Install dependencies
30
+
31
+
This software depends on python and its package index. The pip dependencies are listed in [pyproject.toml](pyproject.toml).
32
+
33
+
##### Manage dependencies using venv
34
+
35
+
You can manage your (virtual) python environment for this project using [venv](https://repology.org/project/python%3Avirtualenv/packages) and [pip](https://repology.org/project/python%3Apip/packages).
36
+
Make sure they are installed on your system and run the following setup commands:
37
+
38
+
```shell
39
+
python -m venv venv
40
+
source venv/bin/activate # Linux, BSD, MacOS
41
+
# venv\Scripts\activate # Windows
42
+
pip install .
43
+
```
44
+
45
+
Make sure to activate your venv (second line above) in every shell you want to interact with your venv. Some IDEs do this automatically for you.
46
+
47
+
By running `src/manage.py` you can [run Django commands and do administration](https://docs.djangoproject.com/en/5.1/ref/django-admin/).
48
+
49
+
#### Local settings
50
+
51
+
The [project settings](src/shiftings/settings.py) are already setup for development mode (`DEBUG = True`). Feel free to have a look at the settings or adapt them to your needs. If you just want to try out the software, no action is required.
52
+
53
+
#### Database setup
54
+
55
+
The script [setup_db.sh](setup_db.sh) initializes your database with the schema matching the shiftings models (running `manage.py migrate`) and [loading the fixtures](https://docs.djangoproject.com/en/5.1/howto/initial-data/) providing example data. Execute it for having a local database:
56
+
57
+
```shell
58
+
sh setup_db.sh
59
+
```
60
+
61
+
#### Development server
62
+
63
+
Django provides a simple development server supporting live reload on code change. You can run it with the following command:
64
+
65
+
```shell
66
+
python src/manage.py runserver
67
+
```
68
+
69
+
After that you can access your local shiftings instance at <http://127.0.0.1:8000/>.
70
+
71
+
#### User fixtures
72
+
73
+
In development mode you can switch between the pre-defined user fixtures with a button in the context menu at the top right of the web page or you can login using the lower case name as username and password (`bob`, `perry` etc.). **Bob** is a superuser and has access to the [Django admin page](http://127.0.0.1:8000/admin/) and **Perry** is a staff member. The other users have [different access to the first example organization](http://127.0.0.1:8000/organizations/1/admin/) provided by the fixture. Follow the provided links for more info.
74
+
75
+
#### Upgrade Django version
76
+
77
+
View the [Django documentation for upgrading Django projects](https://docs.djangoproject.com/en/5.1/howto/upgrade-version/). After switching to an newer version, make sure there are no warnings or errors by running
78
+
79
+
```shell
80
+
python -W all src/manage.py check --deploy
81
+
```
82
+
83
+
### Deployment / Shared setup
84
+
85
+
This section describes a shared setup deployed on a server for common use in an organization.
86
+
87
+
See [Django docs](https://docs.djangoproject.com/en/4.1/howto/deployment/) for details on how to deploy a Django application.
24
88
25
89
1. Clone the repository
26
90
1. Configure your WSGI Server
27
91
1. Add a local_settings.py. See local_settings.sample.py for inspiration.
28
92
1. Add a cron, systemd timer unit or similar for recurring shift creation
0 commit comments