Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/muneeb706/django-graphql
GraphQL API tutorial with graphene-django
https://github.com/muneeb706/django-graphql
django graphene-django graphql python
Last synced: 24 days ago
JSON representation
GraphQL API tutorial with graphene-django
- Host: GitHub
- URL: https://github.com/muneeb706/django-graphql
- Owner: muneeb706
- Created: 2021-11-22T03:08:58.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-16T08:43:24.000Z (9 months ago)
- Last Synced: 2024-02-16T09:37:54.706Z (9 months ago)
- Topics: django, graphene-django, graphql, python
- Language: Python
- Homepage:
- Size: 1.41 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GraphQL API in Django with graphene-django
Follow the steps below to run this project:
1. Make sure you have the following development environment:
1. Python 3.9.7 (You can be flexible with the version but, I have tested with this version only).
1. Any IDE or text editor of your choice.
1. Access to Command-Line or Terminal1. Clone this repository.
1. Open the terminal or command line.
1. Navigate to the location where you cloned this repository.
1. Install the dependencies by typing following command:
`pip install -r requirements.txt`1. Migrate Django models to the database (SQLite) by typing following commands in order:
`python manage.py makemigrations`
`python manage.py migrate`
1. Run the Django server by entering following commands in order:`python manage.py runserver`
Now, the project should be up and running. By default django server runs in localhost:8000 and you should be able to access the GraphiQL interface by typing
http://localhost:8000/graphql address in the address bar of the browser.### How to enable CORS:
To connect with this API locally, you might need to disable cors. Follow these steps mentioned in https://www.stackhawk.com/blog/django-cors-guide/ for this purpose: