Giter Club home page Giter Club logo

chatroom's Introduction

網路聊天室 Online Chat Room

網頁DEMO連結

image image

概述

具有用戶註冊、第三方快速登入功能,可在聊天室上發布文章並在底下進行回覆。

專案引用

本網站主要參考StudyBud這個專案,並加以修改、完善。


套件安裝

一鍵安裝套件

pip3 install -r requirements.txt

使用說明

網站伺服器開啟

# for https:
python manage.py sslrunserver
# for http:
python manage.py runserver

資料庫重新創建(並創建管理員帳號),請按照以下步驟執行:

#1 將bd.sqlite3與migrations的0001_initial.py刪除
#2 /到models.py
   /USERNAME_FIELD = 'email' --> 將這行註解掉
#3 /輸入"python manage.py makemigrations"
   /輸入"python manage.py"
#4 /輸入"python manage.py createsuperuser"
   /創建管理員帳號
#5 /打開可修改SQL資料庫的工具(如:DB Browser(SQLite))
   /打開base_user
   /將管理員帳號的"email"欄位填上email(如:[email protected])
#6 將models.py的USERNAME_FIELD = 'email'註解刪除
#7 /輸入"python manage.py makemigrations"
   /輸入"python manage.py "

做這些步驟的原因是因為我們後續創建User帳戶的時候是使用email與password作為登入選項
但是如果不先修改models.py的USERNAME_FIELD的話,在創建管理員帳戶的時候會缺少username這個選項
進而導致帳戶創建失敗,於是必須先透過以上步驟來進行修改才能創建管理員帳戶


關於第三方帳號快速登入的設定

需要先至Google CloudGitHub Develpers申請OAuth apps

關於如何申請Google的API可以參考這篇文章的前半部分: [ASP.NET] 如何串接 Google Api 帳戶登入

GitHub可以參考這篇文章: Day30 : Django 第三方登入 - 以Github為例

TODO

  • 文章換行
  • 增加忘記密碼功能

chatroom's People

Contributors

kerycheng avatar

Stargazers

Sayan Maity avatar  avatar

Watchers

 avatar

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.