If there are any issues with `psycopg2` and that it cannot be imported, you might be missing `libpq-dev`. If you are using a virtual environment, install it with `sudo apt-get install libpq-dev`.
If there are any issues with `djangorestframework` or rather the import of `rest_framework`, try installing it again with the active environment using `python -m pip install djangorestframework`.