Giter Site home page Giter Site logo

jeniturtle / django-graphql Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 3.67 MB

django + graphql实现前后端分离。支持jwt登录效验,以及resolver权限绑定。

Python 20.87% JavaScript 62.09% HTML 10.72% ASP 0.06% Java 0.02% PHP 0.80% CSS 5.45%

django-graphql's Introduction

django_graphql


django + graphql实现前后端分离。支持jwt登录效验,以及resolver权限绑定。

一、安装依赖

pip install -r requirements.txt


二、配置数据库链接

打开core/setting.py,找到databases选项并修改

# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'jouryu_django',
        'USER': 'root',
        'PASSWORD': '!',
        'HOST': '127.0.0.1',
        'OPTIONS': {
            'init_command': 'SET default_storage_engine=INNODB;'
        }
    }
}

三、创建数据库

例:CREATE DATABASE jouryu_django DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;


四、执行makemigrations命令

python manage.py makemigrations


五、执行migrate命令

python manage.py migrate


六、创建超级管理员

python manage.py createsuperuser


六、进入xadmin后台

http://127.0.0.1:8000/xadmin


七、进入graphql调试界面

无需效验登录:http://127.0.0.1:8000/unauthorized_graphiql 需要效验登录:http://127.0.0.1:8000/graphiql


django-graphql's People

Contributors

jeniturtle avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

answeryas

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.