4b11b4 / potify

[S]potify generic music player learning project
0 stars 1 forks source link

Installing djangorestframework #5

Closed 4b11b4 closed 5 years ago

4b11b4 commented 5 years ago

What's the proper way to install this?

For this issue I am strictly talking about installation, not setting up urls or anything within django.

  1. I know you initially need to type: "workon potify"... What bash commands need to be run next?
  2. pip install djangorestframework
  3. add a line in requirements.txt?
  4. Anything else?
zachcalvert commented 5 years ago

Yep pretty much. The steps I follow when adding a new pip package to a project is:

  1. workon potify
  2. pip install djangorestframework
  3. pip freeze > requirements.txt (from the appropriate directory)
  4. git add requirements.txt .. git commit etc, so that the new package gets tracked appropriately
4b11b4 commented 5 years ago

I did the steps above, seems to have installed successfully, and pushed the requirements.txt. If you changed to this branch and pulled the branch tip, that only updates the requirements.txt.

  1. How does the virtualenv on your local machine get updated?
  2. What is the next step for installing the djangorestframework?
4b11b4 commented 5 years ago

from: https://www.django-rest-framework.org/

Add 'rest_framework' to your INSTALLED_APPS setting.

INSTALLED_APPS = ( ... 'rest_framework', )

This code is located in: potify/potify/settings.py

I added the 'rest_framework' to DJANGO_APPS, above INSTALLED_APPS.

Is this the correct location?

zachcalvert commented 5 years ago

Ah yea nice catch, I missed that step, that's correct location.

The DJANGO_APPS vs LOCAL_APPS separation is a recommendation from two scoops of django (I believe), and DJANGO_APPS is where any django packages that are being imported for use in the project live.

4b11b4 commented 5 years ago

8