<commit_before># best-blog-in-the-world

Django Girls blog

## Installation

- Create virtualenv. Either `virtualenv virtual && source virtual/bin/activate` or `mkvirtualenv blog && workon blog`
- Install Django `pip install Django`
- Freeze requirements `pip freeze > requirements.txt`
- Note: Next time install project with `pip install -r requirements.txt`

## Install Docker

- For Windows: `https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe`
- For Mac: `https://download.docker.com/mac/stable/Docker.dmg`
- Run Docker service in background

## Setup database

- Create database service `docker-compose up`
- After first boot database service will require restart
- Restart database service with `Ctrl+C` and run again `docker-compose up`
- Do not close database service terminal window
- Change database config in `settings.py`

```python
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'postgres',
        'USER': 'postgres',
        'HOST': 'localhost',
        'PORT': 5433,
    }
}
```

## Configure project for new database

- Apply migrations `python manage.py migrate`
- Create superuser `python manage.py createsuperuser`

## Use DataGrip or PyCharm Professional Database view

- Configure new postgres connection under `localhost:5433`
- Use database `postgres` and login `postgres`
- View tables `auth_user`, `django_migrations` and `blog_post`

## Run

- Run server `python manage.py runserver`

## Start coding

- Use `django-admin startapp $name` or `python manage.py startapp $name` where `$name` is your name<commit_msg>Update readme.<commit_after># best-blog-in-the-world

Django Girls blog

## Installation

- Create virtualenv. Either `virtualenv virtual && source virtual/bin/activate` or `mkvirtualenv blog && workon blog`
- Install Django `pip install Django`
- Freeze requirements `pip freeze > requirements.txt`
- Note: Next time install project with `pip install -r requirements.txt`

## Install Docker

- For Windows: `https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe`
- For Mac: `https://download.docker.com/mac/stable/Docker.dmg`
- Run Docker service in background

## Setup database

- Create database service `docker-compose up`
- After first boot database service will require restart
- Restart database service with `Ctrl+C` and run again `docker-compose up`
- Do not close database service terminal window
- Change database config in `settings.py`

```python
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'postgres',
        'USER': 'postgres',
        'HOST': 'localhost',
        'PORT': 5433,
    }
}
```

## Configure project for new database

- Apply migrations `python manage.py migrate`
- Create superuser `python manage.py createsuperuser`

## Use DataGrip or PyCharm Professional Database view

- Configure new postgres connection under `localhost:5433`
- Use database `postgres` and login `postgres`
- View tables `auth_user`, `django_migrations` and `blog_post`

## Run

- Run server `python manage.py runserver`

## Start coding

- Create your own branch `git checkout -b $name`
- Use `django-admin startapp $name` or `python manage.py startapp $name` where `$name` is your name
- Add changes with `git add . && git commit -m "Your message here."` 
- Push it to GitHub `git push origin $name`
{'fraction_non_alphanumeric': 0.11235294117647059, 'fraction_numerical': 0.00823529411764706, 'mean_word_length': 4.023633677991137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6104396', 'n_tokens_mistral': 1042, 'n_tokens_neox': 996, 'n_words': 353}