The goal of gitensite is to:
-
provide information about the GITenberg project
-
document the major areas of work of GITenberg
-
connect visitor with areas to contribute
-
list information about GITenberg books
-
distribute completed ebooks
This is a django/python project, so you are going to want to use some standard python dev tools.
Copy example.env
to .env
and store your local db secret and other values there.
Load that file into your environment with:
source .env
Virtual environments in python are a way of separating and reproducing the python package requirements.
From the root of the project
sudo pip install virtualenv virtualenv venv source venv/bin/activate pip install -r requirements.txt
For every new terminal, or when returning to work on the project, you will need to run
source venv/bin/activate
On OSX, apple occasionally moves cffi’s location, which bcrypt depends on. This causes pip to fail when installing. Deactive your virtualenv, set a bash variable, and install system-wide.
$ # Instal homebrew. See http://brew.sh $ # Install cffi. See https://cffi.readthedocs.org/en/latest/#macos-x # you may need to find and set include_dirs in setup.py $ brew install pkg-config libffi $ pip install bgcrypt $ source venv/bin/activate
We use Postgres in production/staging and sqlite in local development.
To start a local db run:
./manage.py migrate ./manage.py createsuperuser
If you have modified the database, generate new database migrations:
./manage.py makemigrations
And run them with:
./manage.py migrate
To fill out data in your local db, you can run the provided pull_repos
management command:
./manage.py pull_repos <username>
Where <username>
is your github account username.
Note
|
This can be any github account. Not only github users who are members of any particular GITenberg organization. |