Giter Site home page Giter Site logo

asifurrouf / locust_django_api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mjmcconnell/locust_test_api

0.0 1.0 0.0 32 KB

Simple django api used for experimenting with the http://locust.io/ load testing tool

Makefile 11.51% Python 87.15% HTML 1.34%

locust_django_api's Introduction

Locust test app


Django Python

Overview


Platform

  • OS: Ubuntu 14.04 LTS
  • Language: Python 2.7
  • Framework: Django 1.8 / Django Rest Framework 3.3.1
  • Database: Postgres

Using the app

This app uses a .env file to handle all sensitive data. This file should be located inside the app directory (beside the manage.py file), and populated with the fields below, Note any lists in the .env file, should be represented by a comma seperated string.

ENV="LOCAL"

ALLOWED_HOSTS="127.0.0.1,localhost"
SECRET_KEY=random_string
DATABASE_URL="postgres://locust:locust@db/locust"

Running the app

The easiest way to run this app is with Docker and the makefiles. Ensure docker is installed on your system (Installation instructions), and in your terminal run:

$ make run

This will boot up a docker container exposing ports 8000 (app) and 5432 (db). Then visit the running application http://localhost:8000

*Note if you are running this with boot2docker, ensure you have mapped your vm's ports are mapped correctly with:

VBoxManage controlvm boot2docker-vm natpf1 "django,tcp,127.0.0.1,8000,,8000"

Check out the Makefile in the repository root for all available commands.

API

This apps primary functionality is to load test against api endpoints, so there is no frontend build. The app is built with django rest framework which provides a nice interface for navigating through the api, but we also provide more detailed documentation of all the apis with the Swagger UI.

To view the api docuemtation navigate to:

localhost:8000/docs/

Admin account

An admin account is added by default, to allow access to the admin sections.

Username: locust
Password: locust

Stopping the app

To stop the app, simply press Ctrl+C in the running terminal.

Running Locust.io

The locust server is running on port 8089 so its accessable at http://localhost:8089. Currently locust is setup to run through each section of the app performing a set of actions:

Hit base view (list)
Create a new record
Navigate to new record
Update new record
Delete record

locust_django_api's People

Contributors

mjmcconnell avatar

Watchers

 avatar

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.