Skip to content
decice serializer class dynamically based on viewset actions
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Decide serializer class dynamically based on viewset actions

Installation steps

I assume python3.7 is available in system path at /usr/bin or /usr/local/bin directory. If you don't have it then I would recommend to install it (for example, sudo apt install python3.7)!

Also, please upgrade pip via pip install --upgrade pip --user

  • clone the repository via git clone and change directory to it via cd drf-serializer-class-dynamic

  • create virtualenv via virtualenv --python=/usr/bin/python3.7 venv

  • active virtualenv via source venv/bin/activate\

  • install the dependencies via pip install -r requirements.txt

  • change directory to webapp via cd webapp

  • run migrations via python migrate

  • load fixtures available for sample app via python loaddata sample

  • run the web application server via python runserver

  • There are three users available in fixtures as follows:

    email password is_superuser is_staff admin yes yes 1234 no no 1234 no no
  • get logged in via username at url http://localhost:8000/api-auth/login/

  • visit http://localhost:8000/api/v1/ and that's it.

You can’t perform that action at this time.