Skip to content

prabathbr/django_api1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

Django Restful API Example

This project is to help you with the following:

  1. To show how to use the Django REST framework
  2. As an independent API backend for the example bootstrap project https://github.com/DataDisca/bootstrap1

Contributors

Database Configuration

To use SQLite or PostgreSQL database comment/uncomment the corresponding section of the settings.py

# DATABASES = {
#     'default': {
#         'ENGINE': 'django.db.backends.sqlite3',
#         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#     }
# }

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'dj_api',
        'USER': 'xxx',
        'PASSWORD': 'xxxxx',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

Make sure you run migrations after changing the database.

Using the Rest Framework Interface

You may need to uncomment the following line in the settings.py to use the rest framework interface:

# 'rest_framework.authentication.BasicAuthentication',

But, it may interfere with the token authentication in the bootstrap theme. Therefore after testing APIs, recomment the above line.

Token timeout

Configure settings.py

TOKEN_EXPIRE_TIME = 1500 # Seconds,

New features in this version

  • Token timeout

Sponsor

DataDisca Pty Ltd, Melbourne, Australia

https://www.datadisca.com

About

Django Restful API Example

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 87.5%
  • HTML 12.5%