GithubHelp home page GithubHelp logo

farzadex-eth / djangochatgpt Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 70 KB

Django ChatGPT Client

License: MIT License

Python 62.87% JavaScript 14.63% CSS 4.62% HTML 17.89%
chatgpt chatgpt-api chatgpt-python django django-application django-project html-css-javascript

djangochatgpt's Introduction

Django ChatGPT Client

This project is a django implementation of using OpenAI API key to have a custom ChatGPT client. Notice: You need OpenAI API key so you can use this project. Get it from here

Sample Image

Features

  • The default settings of the project is that the admin creates users in the database and each user can have its own chat history.
  • Users have to login to to have access to the chat.
  • After each refresh or login user sees 10 recent messages.
  • Admin can create users and give them access to use the chat. Also Admin can limit how many tokens they can use. The default for free trial is 4096 tokens. Learn more about tokens in chatgpt here
  • The send function checks the token limit of the user and sends the best number of messages in history of user's chat, so it doesn't get token limit error.

How to use

  1. Clone the project
  2. Go to the project's directory
    cd DjangoChatGPT
  3. Create a virtual env
    python3 -m venv venv
  4. Activate the venv
  • Linux:
    source venv/bin/activate
  • Windows:
    venv\Scripts\activate.bat
  1. Install requirements

    pip install -r requirements.txt
  2. Add your API key in "chatgptclient/settings.py"

    API_KEY = "YOUR OPENAI API KEY"
  3. Run the project: Make sure venv is activated

    cd chatgptclient
    python manage.py makemigrations
    python manage.py migrate
  • Create superuser (admin) so you can access admin page
    python manage.py createsuperuser
    python manage.py runserver
  • In the browser the website runs on "http://127.0.0.1:8000" by default.
  • You can go to "http://127.0.0.1:8000/admin/" to add Users.
  • Also you have to add your admin user or any new user in ExtUser Table to allow access to use their own chat.

djangochatgpt's People

Contributors

farzadex-eth avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

lspongebobjh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.