Coder Social home page Coder Social logo

fullthrottle-test's Introduction

fullthrottle-test

This a Django application with User and ActivityPeriod models. Created a custom management command to populate the database with some random data. All the data can be viewed with a REST API in json format.

Usage

Start by cloning the reposirtory.

git clone https://github.com/hritik7080/fullthrottle-test.git

Change your working directory.

cd fullthrottle-test

Then intsall all the required libraries with following command.

pip install -r requirements.txt

Now you have all the dependencies intalled in you system for this projet.
By default the database may be empty. So you can add some dummy data with a custom management command.

python manage.py populate_database 10

This will add 10 values in the Users model. For each user program will create 3 values in ActivityPeriod for start_time and end_time. That means, when you create 10 values for Users model the program will create 30 values for ActivityPeriod model. Start time and end time may not be meaningful as they were generated randomly.

The above command deletes all the previous data and add new data to the database.

To append the new data in the database. Use this command:

python manage.py populate_database 10 --append

This will not delete the previously added data.
To run the application on localhost type following command.

python manage.py runserver

The app is now hosted on your machine.

For Localhost

To get all the data stored in the Database in the json, use following API with get request.

http://127.0.0.1:8000/data/getdata/

You can open this link directly on browser or use postman o check the api.

Check my hosted app

https://fullthrottl-test.herokuapp.com/data/getdata/

Just open this link on browser or postman to check my hosted django appliation.
On postman use get request only.

fullthrottle-test's People

Contributors

hritik7080 avatar

Watchers

James Cloos avatar  avatar

Forkers

ashishgopal1414

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.