Giter VIP home page Giter VIP logo

django-dynamic-services's Introduction

Open-source Django project that showcases the API Generator and other Dynamic Services - actively supported by AppSeed.

๐Ÿ‘‰ Django - Build Services without Coding - video presentation (learn how to use this starter)

Features


Django Dynamic Services - free developer tools provided by AppSeed.


Start the app in Docker

๐Ÿ‘‰ Step 1 - Download the code from the GH repository (using GIT)

$ git clone https://github.com/app-generator/django-dynamic-services.git
$ cd django-dynamic-services

๐Ÿ‘‰ Step 2 - Start the APP in Docker

$ docker-compose up --build

Visit http://localhost:5085 in your browser. The app should be up & running.

๐Ÿ‘‰ Step 3 - Create Superuser in Docker

$ # List containes & get the ID
$ docker container ls  
$ # Create the superuser
$ docker exec <CONTAINER_ID> python manage.py createsuperuser 

Manual Build

๐Ÿ‘‰ Download the code

$ git clone https://github.com/app-generator/django-dynamic-services.git
$ cd django-dynamic-services

๐Ÿ‘‰ Install modules via VENV

$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt

๐Ÿ‘‰ Set Up Database

$ python manage.py makemigrations
$ python manage.py migrate

๐Ÿ‘‰ Generate API

$ python manage.py generate-api     # requires confirmation
// 
$ python manage.py generate-api -f  # no input (API folder is overwritten)

๐Ÿ‘‰ Create the Superuser

$ python manage.py createsuperuser

๐Ÿ‘‰ Start the app

$ python manage.py runserver

At this point, the app runs at http://127.0.0.1:8000/ and the generated API can be found at:

The default API nodes can be tested via this POSTMAN Collection.


How to use the API

  • Start the app
  • Make sure the endpoints are up & running
  • Authenticate via API and het the access token
    • http://localhost:8000/login/jwt/ usind existing credentials
    • Save the token in the requests HEADER
  • GET Requests are public (no token required)
    • GET ALL products: http://localhost:8000/api/product/
    • GET product by ID: http://localhost:8000/api/product/1/
    • GET ALL Sales: http://localhost:8000/api/sales/
  • Create, Delete, Update requires a token in the header

For API sample requests, open and edit the POSTMAN Collection sample.


How Update the API

  • Define or update your models
  • Migrate the database
  • Update the configuration API_GENERATOR section
  • Regenerate the API
    • python manage.py generate-api

At this point, you should be able to use the API. For more information regarding the library used to generate the code, access:

๐Ÿ‘‰ API Generator for Django - Open-Source Library


Codebase structure

The project is coded using a simple and intuitive structure presented below:

< PROJECT ROOT >
   |
   |-- core/                            
   |    |-- settings.py                  # Project Configuration  
   |    |-- urls.py                      # Project Routing
   |
   |-- home/
   |    |-- views.py                     # APP Views 
   |    |-- urls.py                      # APP Routing
   |    |-- models.py                    # APP Models 
   |    |-- tests.py                     # Tests  
   |    |-- templates/                   # Theme Customisation 
   |         |-- includes                # 
   |              |-- footer.py          # Custom Footer      
   |     
   |-- requirements.txt                  # Project Dependencies
   |
   |-- env.sample                        # ENV Configuration (default values)
   |-- manage.py                         # Start the app - Django default start script
   |
   |-- ************************************************************************


Django Dynamic Services - Open-Source Django starter provided by AppSeed

django-dynamic-services's People

Contributors

app-generator 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.