GithubHelp home page GithubHelp logo

django-graphql-starter's Introduction

Django with GraphQL Server

Features

  • Django: Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.

  • Django Rest Framework Django REST framework is a powerful and flexible toolkit for building Web APIs. http://www.django-rest-framework.org/

  • Graphql: GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data.

  • Graphene: A Django integration for Graphene. https://github.com/graphql-python/graphene-django

  • Django corsheaders Django app for handling the server headers required for Cross-Origin Resource Sharing (CORS) https://github.com/ottoyiu/django-cors-headers

Requirements

You need to install Python and add to your Path

Getting started

# 1. Clone the project
git clone [email protected]:inspired-solutions/django-graphql-starter.git

# 2. Navigate to the new project
cd django-graphql-starter

# 3. Activate virtualenv
virtualenv venv -p /path/to/python3
. venv/bin/activate # linux
. venv/Scripts/activate # windows

# 4. Install modules
pip3 install -r requirements.txt

# 5. Apply Migrations
./manage.py migrate

# 6. Start server (runs on http://localhost:8000)
./manage.py runserver

Documentation

Commands

  • pip install -r requirements Install all modules described in requirements.txt
  • python manage.py migrate Apply migrations to database
  • python manage.py runserver Start server

Project structure

File name Description
├── .gitignore Lists the files and directories that Git should ignore
├── core Contains all files that are related to the core app
│   ├── __init__.py
│   ├── admin.py Contains django’s admin interface of core
│   ├── apps.py Application configuration of core
│   ├── migrations Contains all migrations of core app
│   │   └── __init__.py
│   ├── models.py Contains models of core app
│   ├── schema.py Connect models from Django ORM to graphene object types
│   ├── schemas Contains all graphene object types
│   │   ├── auth.py Auth graphene object types
│   │   ├── group.py Group graphene object types
│   │   ├── permission.py Permission graphene object types
│   │   └── user.py User graphene object types
│   ├── tests.py Contains tests of core app
│   └── views.py Contains views of core app
├── djangographql Contains all files that are related to the Django Application
│   ├── __init__.py
│   ├── local_settings.example.py Contains a example of local settings
│   ├── local_settings.prod.py Contains production settings
│   ├── middleware.py Contains middlewares
│   ├── schema.py Connect models from Django ORM to graphene object types
│   ├── settings.py Contains django default settings
│   ├── urls.py Contains urls
│   ├── utils.py Contains utils files
│   └── wsgi.py Contains Web Server Gateway Interface configuration
├── manage.py
├── requirements.txt A list of Python packages required
└── tox.ini Virtualenv configuration file

Deployment

cp djangographql/local_settings.prod.py djangographql/local_settings.py

nano djangographql/local_settings.py  # update settings

./manage.py migrate

./manage.py collectstatic

Contributing

The django-graphql-starter are maintained by the Inspired Solutions.

Your feedback is very helpful, please share your opinion and thoughts! If you have any questions or want to contribute yourself, join the #django-graphql-starter channel on our Slack.

django-graphql-starter's People

Contributors

helpse avatar edcornejo avatar dbritto-dev avatar gerardgun avatar

Watchers

Jorge Cosgayon avatar James Cloos 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.