3
0
Fork
You've already forked DjangoCLIChat
0
A two-way chat app that runs in the CLI, using Curses for the UI and Django's ORM to store and retrieve message history.
  • Python 97.1%
  • Dockerfile 2.9%
2026年01月08日 15:01:12 -05:00
.devcontainer initial commit. migrating from my own repo 2026年01月05日 13:20:41 -05:00
db adding contact model, for class demo today 2026年01月08日 10:07:55 -05:00
logs initial commit. migrating from my own repo 2026年01月05日 13:20:41 -05:00
orm initial commit. migrating from my own repo 2026年01月05日 13:20:41 -05:00
.gitignore initial commit. migrating from my own repo 2026年01月05日 13:20:41 -05:00
chat_er_diagram.md filename typo 2026年01月08日 10:08:54 -05:00
django_shell_orm_test.txt add a note about importing models on Django 4 shell 2026年01月08日 15:01:12 -05:00
manage.py initial commit. migrating from my own repo 2026年01月05日 13:20:41 -05:00
README.md typo fix 2026年01月05日 13:21:17 -05:00
socket_chat_curses.py initial commit. migrating from my own repo 2026年01月05日 13:20:41 -05:00

This is a two-way chat app which uses:

  • Curses for the front-end
  • Python's sockets library for communication
  • Django's ORM to save chat history in a Sqlite3 database.

To use:

  • Sender and receiver should both checkout this repo
  • Initialize the django project:
    • Setup a virtual environment, activate it, and install django:
      • python3 -m venv .venv
      • source .venv/bin/activate
      • pip install django
    • Create a database based on the models described in db/models.py:
      • python3 manage.py makemigrations db
      • python manage.py migrate
  • Run python3 socket_chat_curses.py. It will automatically listen on 0.0.0.0 and will randomly choose a port number. Type in your partner's ip address and port number, and start chatting.

To learn more about the django orm code, check out the dedicated repo here: https://github.com/cj0ne5/django_orm_for_csc221.

Which heavily borrows from code in Dan Caron's 'Django ORM Standalone project, here: https://github.com/dancaron/Django-ORM. The below copyright notice comes from that repo.

License

The MIT License (MIT) Copyright (c) 2024 Dan Caron

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.