Skip to content

cunhaax/django-rest-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Using a virtual environment to install dependencies

Using the venv module that is now part of the standard library (python 3.3+). Might not be installed in some Linux distros and in that case sudo apt-get install python3-venv should do it for Ubuntu.

# creating the virtual env
$ python3 -m venv <your_env_dir>
# activating the environment
$ source <your_env_dir>/bin/activate

Installing dependencies

$ pip install -r requirements.txt

Db migration

The configured database is sqlite (just for demonstration purposes)

$ python manage.py migrate
# create an administrator account
$ python manage.py createsuperuser --email [email protected] --username admin

Run the tests

$ python manage.py test

Run the app

$ python manage.py runserver

This project is using the Django's REST framework api view, so it has also an html ui at localhost:8000/loans.

The admin has access to everything but it's possible to create other users and play around with the permissions by accessing localhost:8000/admin

About

Example of a REST API with Django REST

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages