Skip to content
kmh11 edited this page Jul 19, 2017 · 7 revisions

Run with Docker

Docker images running the latest version of djangoctf are available on Docker Hub from the automated build repository tning05/djangoctf. Launching a development instance of djangoctf from the Docker image is simple:

$ docker run --name djangoctf -p 8000:8000 -d tning05/djangoctf

Then visit http://localhost:8000 from your local machine to access your instance of djangoctf.

Manual installation

Make sure you have git, Python, and pip installed on your computer. We'll need these to use the project.

Nix and Nix-like Systems (Linux, Unix, OS X, etc.)

Many distros already come with git and Python, but if yours doesn't, get it through your package manager(apt-get, brew, etc.). Make sure you have Python 3.x. djangoctf requires Python 3.0+ to run because some files contain things like function annotations. If you want, you can run djangoctf in its own Python virtual environment with virtualenv or pyenv. Then, head to this page to install pip. Make sure to read the warnings and instructions.

Clone this repository using:

git clone https://github.com/angstromctf/djangoctf.git for https and

git clone [email protected]:angstromctf/djangoctf.git for ssh.

To install all of the dependencies, open a terminal emulator of your choice and cd to the djangoctf directory. Run sudo pip install -r requirements.txt and let this finish. You should now be able to run python manage.py without any errors. You'll see that this command outputs a list of possible commands.

To run the djangoctf server locally for testing, run python manage.py runserver --insecure (--insecure enables local caching). You should now see djangoctf running on localhost:8000!


Windows

If you already have a proper terminal emulator (Cygwin or MinGW), just follow the instructions for Nix above.

Else:

First, install Python 3.0+ from the Python website. You should use Python 3.5, as it is the most recent stable release of Python. Download and run the executable(it may prompt you for UAC). Check the box that says "Add Python to environment variables" and then click "Install now". To check that python is properly installed, execute:

python --version

in cmd.exe. It should say

Python 3.x.x

where x represent some numbers. After installing Python, you need to install pip, a package manager for Python. If you downloaded Python 2 >= 2.7.9 or Python 3 >= 3.4, pip is already installed. Else, download the get-pip.py file from the pip website.

Configuration

Configuration settings are stored in djangoctf/settings.json. An example configuration file is included with djangoctf as settings.json.example.

###Troubleshooting If manage.py crashes, make sure that you're using Python 3 and that all dependencies are installed. On some systems when installing, you may need to explicitly invoke pip as pip3 for pip to install the tools for Python 3. This usually happens when there are multiple versions of Python, as the system usually defaults to Python 2 for legacy purposes.