> For the complete documentation index, see [llms.txt](https://olee-tech.gitbook.io/django/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://olee-tech.gitbook.io/django/channels/create-project.md).

# Create Project

package install

```bash
pip install channels
```

create project

```bash
django-admin startproject ChatApplication
```

Create App

```bash
cd ChatApplication
python manage.py startapp chat
```

Project settings.py

```python
INSTALLED_APPS = [
    'channels',
    'chat',
]
```

link app urls.py to project urls.py

```python
from django.urls import path
from . import views
urlpatterns = [
    path('index',views.index,name='index'),
    
]


```

```python
#project urls.py

from django.contrib import admin
from django.urls import path,include

urlpatterns = [
    path('admin/', admin.site.urls),
    path('',include('chat.urls')),
]

```

views.py

```python
from django.shortcuts import render
import random

def index(request):
    # Generate a random number
    random_number = random.random()

    # Return the HTML template with the random number
    return render(request, 'index.html', {'random_number': random_number})
```

database migrations and run server

```
python manage.py migrate
python manage.py runserver
```
