Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve developer instructions #1279

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions docs/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Without Feedback improvement can't happen, so don't hesitate to say what you wan
Code contributions are always welcome. There is no special rules for what you need to do,
just do your best and we will work together to get your idea and code merged into the project.

You may want to run "python manage.py collectstatic" and then "pytest" to make sure all unit tests are still working.

!!! info
The dev setup is a little messy as this application combines the best (at least in my opinion) of django and Vue.js.

Expand All @@ -22,22 +24,29 @@ This application is developed using the Django framework for Python. They have e
[documentation](https://www.djangoproject.com/start/) on how to get started, so I will only give you the basics here.

1. Clone this repository wherever you like and install the Python language for your OS (at least version 3.8)
2. Open it in your favorite editor/IDE (e.g. PyCharm)
2. Open it in your favorite editor/IDE (e.g. PyCharm) or plain command prompt
1. If you want, create a virtual environment for all your packages.
3. Install all required packages: `pip install -r requirements.txt`
1. On Windows you may be asked you to install the [Buildtools für Visual Studio 2022](https://visualstudio.microsoft.com/de/downloads/) to build some of the requied modules. In "Visual Studio Installer" you have to select "Desktopdevelopment with C++" for this.
2. If it complains about missing 'lber.h', you may want to replace "django-auth-ldap" and "python-ldap" in requirements.txt with "django-python3-ldap" instead of building the required OpenLDAP.
4. Run the migrations: `python manage.py migrate`
5. Start the development server: `python manage.py runserver`
6. Keep this console open and go on with the next chapter "Vue.js"

There is **no** need to set any environment variables. By default, a simple sqlite database is used and all settings are
populated from default values.

### Vue.js
Some of the more complex pages use [Vue.js](https://vuejs.org/) to enhance the frontend.

In order to work on these pages you will have to install a Javascript package manager of your choice. The following examples use yarn.
In order to work on these pages you will have to install a Javascript package manager of your choice. The following examples use yarn. To [install yarn](https://classic.yarnpkg.com/lang/en/docs/install), you need [Node.js](https://nodejs.org/en/download/current/) first.

1. Open a shell in the "vue" subdirectory
2. Run `yarn install` to install the dependencies.
1. if you get an error "ERR_OSSL_EVP_UNSUPPORTED", run "export NODE_OPTIONS=--openssl-legacy-provider"(Unix) or "set NODE_OPTIONS=--openssl-legacy-provider"(Windows)
3. After that you can use `yarn serve` to start the development server and go ahead and test your changes.

Run `yarn install` to install the dependencies. After that you can use `yarn serve` to start the development server
and go ahead and test your changes. Before committing please make sure to pack the source using `yarn build`.
Before committing please make sure to pack the source using `yarn build`.

#### API Client
The API Client is generated automatically from the openapi interface provided by the django rest framework.
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
wheel>=0.37.0
Django==3.2.11
cryptography==36.0.1
django-annoying==0.10.6
Expand Down Expand Up @@ -40,7 +41,10 @@ django-storages==1.12.3
boto3==1.20.27
django-prometheus==2.2.0
django-hCaptcha==0.1.0
#Unix:
python-ldap==3.4.0
django-auth-ldap==4.0.0
#Windows:
#django-python3-ldap
pytest-factoryboy==2.1.0
pyppeteer==0.2.6