Coder Social home page Coder Social logo

hu651252627 / news Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cherish-sun/news

0.0 0.0 0.0 10.89 MB

基于Django前后端分离开发-新闻管理系统

Python 41.47% HTML 3.65% JavaScript 31.23% ASP 0.03% Java 0.01% PHP 0.42% CSS 2.53% C 4.05% C++ 2.13% Batchfile 0.01% PowerShell 0.09% Tcl 13.97% TSQL 0.40%

news's Introduction

NEWS

基于Django前后端分离开发-新闻管理系统

一、开发目的

通过新闻系统前后端分离开发,在后端开发web api的过程中让你快速熟练掌握django rest framework框架的开发,让你要项目实战中掌握rest 标准api的开发技术。在前端开发让你快捷简便的掌握django模板调用api的过程。

二、开发环境

•开发工具:Pycharm

•开发环境为: Windows10、Python3.6.8、Django2.0.3、djangorestframework(3.8.2)

•数据库:Mysql5.6

•前端:Div+Css 、ajax

•后端:Django2.0.3、djangorestframework(3.8.2)

三、创建项目和应用

django-admin.py startproject newsapi
python manage.py startapp article

四、安装项目所需依赖包

pip install django==2.0.3
pip install djangorestframework==3.8.2
pip install pymysql
pip install Markdown
pip install django-filter
pip install django-crispy-forms
pip install django-cors-headers
pip install django-rest-swagger

五、配置setting.py

注册app
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'article', # 我们的app
    'rest_framework', # 前后端分离框架
    'crispy_forms',  # 展示表单
    'django_filters', # 查询
    'rest_framework.authtoken',  # 认证
    ]
连接mysql数据库
DATABASES = {
'default': {
    'NAME': 'news',  # 数据库名
    'ENGINE': 'django.db.backends.mysql',
    'USER': 'root',  # 用户名
    'PASSWORD': 'test',  # 密码
    'HOST': '127.0.0.1',  # 主机IP
    'PORT': '3306',  # 端口
    'useSSL': 'false',
  }
}

news.sql可选,可以自己手动添加新闻信息,也直接导入已存在的新闻信息。 项目详解可参考:https://www.jianshu.com/nb/34691463

news's People

Contributors

cherish-sun 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.