This is a web application. to set it up, we require a python environment with Django and other project dependencies installed. Though one can work with the project without a virtual environment, it is recommended to use one to avoid conflicts with other projects
- Make sure that you have
Python 3
,virtualenv
andpip
installed. - Clone the repository
$ git clone https://github.com/RMKCET-AI/tesseract.git $ cd tesseract
$ docker pull thunder07/tesseract:latest
- Create a python3 virtualenv, activate the environment and Install the project dependencies.
- For linux/macintosh:
$ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt
- For windows:
python -m venv venv venv/Scripts/activate.bat pip install -r requirements.txt
Refer docker documentation for installation
$ docker-compose build
$ docker-compose up
You have now successfully set up the project on your environment.
From now when you start your work, run source bin/activate
inside the project repository and you can work with the django application as usual -
python manage.py makemigrations
python manage.py migrate --run-syncdb
python manage.py createsuperuser
python manage.py runserver
We can perform all user crud operations using only one end point in the application which is /api/
- Must use api key to access the api which can be generated by admin to ensure data security
- using different query_param you can access different kinds of data
Get
random_user
query_param to pick random user.page_number
andpage_size
to specify the pagination of api.all_users
to get all users data
Post
- Formdata must include
user_name
,first_name
,last_name
,email
,contact_number
,address
andpassword
Put
- Put takes the same params as get and updated the whole record it takes primary key
pk
as identifier
Patch
- Patch can be one or more params that are in Post to update individual records it takes primary key
pk
as identifier
Delete
- Delete takes the primary key
pk
as param and deletes the particular record
Make sure you pull new changes from remote regularly.