pawl / django_api_forms_modelchoicefield_example

An example of using Django API Forms (https://github.com/Sibyx/django_api_forms) with a ModelChoiceField.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An example of using Django API Forms with a ModelChoiceField.

Installation

  1. Clone this repository and navigate to the directory.
  2. Create virtualenv: virtualenv .venv
  3. Activate the virtualenv: source .venv/bin/activate
  4. Install dependencies: pip install -r requirements.txt
  5. Initialize database schema: python manage.py migrate
  6. Load initial data: python manage.py loaddata myapp/fixtures/*

Usage

Start the back-end in your first terminal: python manage.py runserver

Run this command to POST json to the api: curl -X POST -H "Content-Type: application/json" -d @./example.json http://localhost:8000/

Watch the terminal for results.

About

An example of using Django API Forms (https://github.com/Sibyx/django_api_forms) with a ModelChoiceField.


Languages

Language:Python 100.0%