Imooc Django

高仿慕课网:py3.5 + Django1.10 + xadmin 搭建的在线课程教育平台
Alternatives To Imooc Django
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Rocket.chat35,724
18 hours ago5August 18, 20222,966otherTypeScript
The communications platform that puts data protection first.
Appwrite31,516
13 hours ago49September 14, 2022756bsd-3-clauseTypeScript
Build Fast. Scale Big. All in One Place.
Hydra14,0838a day ago1May 08, 201977apache-2.0Go
OpenID Certified™ OpenID Connect and OAuth Provider written in Go - cloud native, security-first, open source API security for your infrastructure. SDKs for any language. Works with Hardware Security Modules. Compatible with MITREid.
Prefect12,0761709 hours ago162July 05, 2022518apache-2.0Python
The easiest way to orchestrate and observe your data pipelines
Rap2 Delos7,468
2 months ago82mitTypeScript
阿里妈妈前端团队出品的开源接口管理工具RAP第二代
Jupyterhub7,207255115a day ago66June 06, 2022188otherPython
Multi-user server for Jupyter notebooks
Nakama7,15812 days ago72November 28, 2020114apache-2.0Go
Distributed server for social and realtime games and apps.
Dockercraft6,300
2 years agoJuly 12, 202218apache-2.0Lua
Docker + Minecraft = Dockercraft
Heimdall6,061
3 days ago28mitPHP
An Application dashboard and launcher
Docker Ipsec Vpn Server5,532
11 days ago2otherShell
Docker image to run an IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2
Alternatives To Imooc Django
Select To Compare


Alternative Project Comparisons
Readme

IMOOC

环境

  • Python 3.5
  • Django 1.10.5
  • xadmin 0.6

网站功能

网站功能脑图

快速启动该项目

  1. 安装 mysql
  2. 安装 python3
  3. 建立虚拟环境(可选步骤)
git clone https://github.com/zaxlct/MxOnline_Django
cd MxOnline_Django
make dev
# 建立一个名为 imooc 数据库
make migrate
make run

因为此时数据库为空,所以页面看起来没什么东西,需要手动往数据库里加数据,或者登陆 admin ,添加数据。

使用 docker 快速部署/开发项目

Linux/Mac/Windos 用 Docker 部署项目步骤

Pycharm 启动项目详细步骤

  • 克隆项目
git clone https://github.com/zaxlct/MxOnline_Django
  • 下载项目依赖
make dev
  • 配置数据库
  1. 确保你已经安装了 MySQL
  2. settingsdev.py里的 DATABASES 填入你的本地的数据库信息(开发环境),settings.py 里填入你服务器的数据库信息(部署环境)。
# 这是我本机的数据库信息,仅提供参考
DATABASES = {
   'default': {
       'ENGINE': 'django.db.backends.mysql',
       'NAME': 'imooc',
       'USER': 'root', 
       'PASSWORD': 'root',
       'HOST': '127.0.0.1',
   }
}
  • 创建数据表
make migrate
  • 配置 PyCharm 项目环境变量

    1. 第一步:点击 Edit Config

    点击 Edit Config

    1. 第二步:点击 环境变量配置

    点击 环境变量配置

    1. 第三步:输入环境变量

    输入环境变量

Name:   DJANGO_SETTINGS_MODULE
Value:  imooc.settingsdev
  • 启动 Django 的 server
make run

settingsdev.py 有什么用?

项目上线时 settings.py 必须设置 DEBUG=False,这时 Django 不会用自带的 server 去加载 js/css/img 等静态文件,需要用 nginx 之类的去做静态文件的 server。     为了避免来回的修改 setting.py,项目开发时的配置在 settingsdev.py 里,项目部署上线时的配置在 settings.py 里。不要随意修改 setting.py

** 注意:PyCharm 默认 settings.py 为配置文件,所以才需要配置 PyCharm 项目环境变量 **

Django 操作 MySql 配置

# 安装 PyMySQL
pip install PyMySQL

# settings.py
import pymysql
pymysql.install_as_MySQLdb()

python3 的一些坑

models.pydef __unicode__(self): => def __str__(self):

Django 1.10 的一些坑

In Django 1.10 django.core.context_processors has been moved to django.template.context_processors

xadmin 不支持 Django 1.11

django 1.11 Lib\site-packages\django\forms\widgets.py 中已经没有了 RadioFieldRenderer 这个类,故 xadmin-python3 分支只支持到 django 1.10

Popular Docker Projects
Popular Server Projects
Popular Virtualization Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
Docker
Server
Django
Mysql
Flask
Qq
Pycharm
Imooc