This project is to help you with the following:
- To show how to use the Django REST framework
- As an independent API backend for the example bootstrap project https://github.com/DataDisca/bootstrap1
- Token timeout : Prabath Hetti Mudiyanselage (GitHub Username: prabathbr)
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.
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.
Configure settings.py
TOKEN_EXPIRE_TIME = 1500 # Seconds,
- Token timeout
DataDisca Pty Ltd, Melbourne, Australia