<commit_before># teslarent

# Setup

Choose between Docker, Generic Setup and Heroku

## Docker
```bash
docker build -t teslarent .
docker run -d -p 444:443 --link mysql-teslarent:mysql -e DJANGO_ALLOWED_HOST='*' -e DJANGO_SECRET_KEY=$DJANGO_SECRET_KEY --name teslarent teslarent
```

## Production deployment

### Environment variables
- DATABASE_URL=postgres/mysql db config, e.g. postgres://postgres:password@192.168.100.100:5432/dbname
- DJANGO_ALLOWED_HOST=your_domain
- DJANGO_SECRET_KEY=random 50 symbol string
- these variables cannot be set in Apache with SetEnv, either set them
 as global environment variables or define them in `./project/settings_prod.py`
- make sure DJANGO_DEBUG is NOT set to True

### Generic Setup

#### Requirements
- Python (tested with version 3.5, others should be fine too)
 - virtualenv, e.g. python3-venv
- Postgres or MySQL database
- Https Web Server with wsgi support, e.g. Apache with mod_wsgi
  (https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/),
  see [apache2_wsgi_sample.conf](https://github.com/flarno11/teslarent/blob/master/apache2_wsgi_sample.conf), adjust python_app_dir and ssl certificates

#### Setup
- Fetch source code and install requirements
```bash
git clone https://github.com/flarno11/teslarent.git
cd teslarent
git checkout release
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp project/settings_prod_sample.py project/settings_prod.py
```

- Make sure config variables are set correctly before continuing,<commit_msg>added howto generate a new django random secret key<commit_after># teslarent

# Setup

Choose between Docker, Generic Setup and Heroku

## Docker
```bash
docker build -t teslarent .
docker run -d -p 444:443 --link mysql-teslarent:mysql -e DJANGO_ALLOWED_HOST='*' -e DJANGO_SECRET_KEY=$DJANGO_SECRET_KEY --name teslarent teslarent
```

## Production deployment

### Environment variables
- DATABASE_URL=postgres/mysql db config, e.g. postgres://postgres:password@192.168.100.100:5432/dbname
- DJANGO_ALLOWED_HOST=your_domain
- DJANGO_SECRET_KEY=random 50 symbol string, generate one with `from django.utils.crypto import get_random_string; get_random_string(50, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)')`
- these variables cannot be set in Apache with SetEnv, either set them
 as global environment variables or define them in `./project/settings_prod.py`
- make sure DJANGO_DEBUG is NOT set to True

### Generic Setup

#### Requirements
- Python (tested with version 3.5, others should be fine too)
 - virtualenv, e.g. python3-venv
- Postgres or MySQL database
- Https Web Server with wsgi support, e.g. Apache with mod_wsgi
  (https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/),
  see [apache2_wsgi_sample.conf](https://github.com/flarno11/teslarent/blob/master/apache2_wsgi_sample.conf), adjust python_app_dir and ssl certificates

#### Setup
- Fetch source code and install requirements
```bash
git clone https://github.com/flarno11/teslarent.git
cd teslarent
git checkout release
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp project/settings_prod_sample.py project/settings_prod.py
```

- Make sure config variables are set correctly before continuing,
{'fraction_non_alphanumeric': 0.09854014598540146, 'fraction_numerical': 0.026155717761557177, 'mean_word_length': 5.034862385321101, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '157541', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1080, 'n_words': 316}