I'm still very new to development...
I would like to simplify django-friendship and add some different functionality. I've forked it on GitHub. I'm not sure what to do next.
Where should the local copy of my django-friendship
repo go?
Should I integrate it into my current Django project as an app, or set it up as a separate project? In which case, how do I set my main Django project to use it as an app while developing it?
Any guidance or other resources I can learn from here would be much appreciated.
Thanks!
from django.shortcuts import render # Create your views here. Find it and open it, and replace the content with this: members/views.py : from django.shortcuts import render from django.http import HttpResponse def index(request): return HttpResponse("Hello world!")
A project refers to the entire application and all its parts. An app refers to a submodule of the project. It's self-sufficient and not intertwined with the other apps in the project such that, in theory, you could pick it up and plop it down into another project without any modification.
There's a few options open to you:
Add the following (replace with your forked repository) to a requirements.txt
file or install directly with pip install
:
git+git://github.com/revsys/django-friendship.git#egg=django-friendship
This will download a copy of your repository into your python environment. If you make changes to the repository however, you'll need to reinstall this every time you push changes.
This method is much cleaner:
// Clone the repository locally
git clone https://github.com/revsys/django-friendship.git
// cd into the project folder
cd django-friendship
// Install the package into your python environment
// The `-e` tells pip this package is editable
pip install -e .
The project is now linked directly. You can now work on the forked repository locally and the changes will be available to your app straight away.
In your requirements.txt
file you'll want to add the following for deployment later:
git+git://github.com/revsys/django-friendship.git#egg=django-friendship
Take a look at the docs for pip for more information on dependency management.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With