|
|
|
## Step 1
|
|
|
|
To install this API on your enviroment, please install requirements for Django: [https://docs.djangoproject.com/en/3.0/topics/install/](https://docs.djangoproject.com/en/3.0/topics/install/)
|
|
|
|
|
|
|
|
## Step 2
|
|
|
|
Install required libraries:
|
|
|
|
* `pip install wheel` (There can be issues when installing rest-framework if wheel is not installed
|
|
|
|
* `pip install pycryptodome==3.4.3`
|
|
|
|
* `pip install crypto`
|
|
|
|
* `pip install Crypto`
|
|
|
|
* `pip install requests`
|
|
|
|
* `pip install urllib`
|
|
|
|
* `pip install djangorestframework`
|
|
|
|
|
|
|
|
## Step 3
|
|
|
|
Clone the repository either by downloading a zip file, or by a git command:
|
|
|
|
|
|
|
|
`git clone https://github.com/developerfromjokela/open-kirkes.git`
|
|
|
|
|
|
|
|
## Step 4
|
|
|
|
Configuration setup:
|
|
|
|
1. Copy/rename file `settings.example.py` to `settings.py`
|
|
|
|
2. Navigate to the project's root, and enter this command: `python cmd_utils/genkey.py`, you'll get a secret key to terminal. Copy that value, and place it in `settings.py`'s `SECRET_KEY` value (i.e. `SECRET_KEY = 'YOUR_GENERATED_KEY'`)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Step 5: explaining `settings.py`
|
|
|
|
|
|
|
|
|
|
|
|
`settings.py` is a configuration file for Django backend.
|
|
|
|
|
|
|
|
### Running in production
|
|
|
|
1. When you want to run in production, add server's domain name to `ALLOWED_HOSTS` array.
|
|
|
|
2. **Disable `DEBUG` by setting it to `False`!**
|
|
|
|
3. You should run django backend via wsgi, learn more at [https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/](https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/)
|
|
|
|
4. It's recommended to use MySQL or other databases instead of SQLite due to performance issues: [https://docs.djangoproject.com/en/3.0/ref/databases/](https://docs.djangoproject.com/en/3.0/ref/databases/)
|
|
|
|
5. Nothing else, it runs fine on its own :wink:
|
|
|
|
|
|
|
|
### Running in development
|
|
|
|
1. Do nothing, you're safe to do anything you want
|
|
|
|
2. (Optional) Change the `SECRET_KEY` |
|
|
\ No newline at end of file |