earn the White PyBites Ninja earn the Yellow PyBites Ninja earn the Orange PyBites Ninja right arrow earn more PyBites Ninja belts and certificates
The best way to learn to code in Python is to actually use the language.

Our platform offers effective Test Driven Learning which will be key to your progress.

Join thousands of Pythonistas and start coding!

Join us on our PyBites Platform
Click here to code!

How to get PyBites up and running on your machine

Posted by Pybites on Tue 20 December 2016 in Tools • 1 min read

This is also a useful ref for future collaborators ...

We're open source right? ;)

Pybites install guide

# we have a src, output and theme (Flex) repo, use --recursive to get all
$ git clone --recursive https://github.com/pybites/pybites.github.io-src pybites
$ cd pybites

# set up env and install dependencies
$ virtualenv venv (might need: virtualenv -p python3 venv)
$ source venv/bin/activate
$ pip install -r requirements.txt

# add some content
$ cd content
$ vi new-blog-post.md ; wq!

# check changes on localhost
$ cd ..
$ make html && make serve

# push this new content to the parent -src repo
$ git add . 
$ git commit -m "my new blog post"
$ git push

# push the static blog change to the child -io repo
# wait: this is a duplicate step, I don't like duplication!
# ...

As we have 2 repos: -src for code, -io for generated static content, ideally we want to automate the publishing to -io, so we can just focus on the main repo (-src).

Here is where git hooks come into play. cd into .git/hooks and add below script, name it "pre-push", update your WORKING_DIR and chmod 755 it ...

UPDATE: we abondonded this hook, because it led to some conflicts / unnecessary work, not worth automating this step. We push manually to -src / -io these days.

See an error in this post? Please submit a pull request on Github.