{{ post.body }}
18 |├── base ├── __init__.py ├── migrations │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-310.pyc │ │ ├── 0001_initial.cpython-310.pyc │ │ └── 0002_post_sender.cpython-310.pyc │ ├── 0002_post_sender.py │ └── 0001_initial.py ├── tests.py ├── __pycache__ │ ├── admin.cpython-310.pyc │ ├── apps.cpython-310.pyc │ ├── urls.cpython-310.pyc │ ├── views.cpython-310.pyc │ ├── __init__.cpython-310.pyc │ ├── models.cpython-310.pyc │ └── serializers.cpython-310.pyc ├── admin.py ├── apps.py ├── serializers.py ├── urls.py ├── models.py └── views.py ├── public_chat ├── __init__.py ├── __pycache__ │ ├── urls.cpython-310.pyc │ ├── wsgi.cpython-310.pyc │ ├── __init__.cpython-310.pyc │ └── settings.cpython-310.pyc ├── asgi.py ├── wsgi.py ├── urls.py └── settings.py ├── .vscode └── settings.json ├── db.sqlite3 ├── preview.png ├── requirements.txt ├── templates ├── main.html ├── login.html └── feed.html ├── readme.md ├── manage.py └── static └── styles └── main.css /base/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public_chat/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /base/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "env/bin/python" 3 | } -------------------------------------------------------------------------------- /base/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/db.sqlite3 -------------------------------------------------------------------------------- /preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/preview.png -------------------------------------------------------------------------------- /base/__pycache__/admin.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/__pycache__/admin.cpython-310.pyc -------------------------------------------------------------------------------- /base/__pycache__/apps.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/__pycache__/apps.cpython-310.pyc -------------------------------------------------------------------------------- /base/__pycache__/urls.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/__pycache__/urls.cpython-310.pyc -------------------------------------------------------------------------------- /base/__pycache__/views.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/__pycache__/views.cpython-310.pyc -------------------------------------------------------------------------------- /base/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /base/__pycache__/models.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/__pycache__/models.cpython-310.pyc -------------------------------------------------------------------------------- /base/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Post 3 | # Register your models here. 4 | 5 | admin.site.register(Post) 6 | -------------------------------------------------------------------------------- /base/__pycache__/serializers.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/__pycache__/serializers.cpython-310.pyc -------------------------------------------------------------------------------- /public_chat/__pycache__/urls.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/public_chat/__pycache__/urls.cpython-310.pyc -------------------------------------------------------------------------------- /public_chat/__pycache__/wsgi.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/public_chat/__pycache__/wsgi.cpython-310.pyc -------------------------------------------------------------------------------- /public_chat/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/public_chat/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /public_chat/__pycache__/settings.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/public_chat/__pycache__/settings.cpython-310.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/migrations/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /base/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BaseConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'base' 7 | -------------------------------------------------------------------------------- /base/migrations/__pycache__/0001_initial.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/migrations/__pycache__/0001_initial.cpython-310.pyc -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.5.2 2 | Django==4.1.1 3 | djangorestframework==3.13.1 4 | djangorestframework-simplejwt==5.2.0 5 | PyJWT==2.5.0 6 | pytz==2022.2.1 7 | sqlparse==0.4.2 8 | -------------------------------------------------------------------------------- /base/migrations/__pycache__/0002_post_sender.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/realtime_chat_django/HEAD/base/migrations/__pycache__/0002_post_sender.cpython-310.pyc -------------------------------------------------------------------------------- /base/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework.serializers import ModelSerializer 2 | from .models import Post 3 | 4 | class PostSerializer(ModelSerializer): 5 | class Meta: 6 | model = Post 7 | fields = '__all__' 8 | -------------------------------------------------------------------------------- /base/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('', views.public_feed, name="feed"), 6 | path('register/', views.register, name="register"), 7 | 8 | path('add/', views.add_post) 9 | ] -------------------------------------------------------------------------------- /base/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | 5 | 6 | class Post(models.Model): 7 | sender = models.CharField(max_length=200, null=True) 8 | body = models.CharField(max_length=250) 9 | created = models.DateTimeField(auto_now_add=True) 10 | 11 | def __str__(self): 12 | return self.body[0:50] -------------------------------------------------------------------------------- /public_chat/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for public_chat project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'public_chat.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /public_chat/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for public_chat project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'public_chat.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /templates/main.html: -------------------------------------------------------------------------------- 1 | 2 | {% load static %} 3 | 4 |
5 | 6 | 7 |{{ post.body }}
18 |