A hack in the form of a micro project
Go to file
coox 9dd05446c6 ungleich_screening_task → ungleich_hack_3 2020-05-12 12:43:08 +02:00
friendly_cat ungleich_screening_task → ungleich_hack_3 2020-05-12 12:43:08 +02:00
require_ipv6 Initial commit of require_ipv6 Django app 2020-05-11 21:45:15 +02:00
ungleich_hack_3 ungleich_screening_task → ungleich_hack_3 2020-05-12 12:43:08 +02:00
.editorconfig Initial commit of .editorconfig 2020-05-08 20:11:07 +02:00
.env.dist Initial commit of require_ipv6 Django app 2020-05-11 21:45:15 +02:00
.gitignore Initial commit of Django project settings 2020-05-10 17:59:30 +02:00
CONTRIBUTING.md Reorganize documentation, add demo URL 2020-05-11 22:28:31 +02:00
Makefile Add static styling to the friendly_cat app 2020-05-11 22:28:31 +02:00
README.md ungleich_screening_task → ungleich_hack_3 2020-05-12 12:43:08 +02:00
manage.py ungleich_screening_task → ungleich_hack_3 2020-05-12 12:43:08 +02:00
requirements.txt ungleich_screening_task → ungleich_hack_3 2020-05-12 12:43:08 +02:00
setup.cfg Initial commit of Black as a development requirement 2020-05-08 20:11:07 +02:00
setup.py ungleich_screening_task → ungleich_hack_3 2020-05-12 12:43:08 +02:00
tests.py ungleich_screening_task → ungleich_hack_3 2020-05-12 12:43:08 +02:00

README.md

ungleich_hack_3

A micro project proposed as a solution for Hack 3: IPv6 cat from ungleich.

Overview

Per requirements, the project behaves differently depending on the version of the Internet Protocol used to navigate it:

  • Via IPv4, it shows a static page saying "Sorry, only reachable by IPv6"
  • Via IPv6, it shows a friendly cat picture

To determine which version is used, we examine the visitors IP address. This is done in a middleware that responds with an error page to non-IPv6 requests.

If the request goes through, a simple application can be accesses, with a single index view showing a friendly picture of a cat.

Usage

To install and run the project on your own computer, you must ensure that the following prerequisites are fulfilled:

Proceed to cloning this repository, and navigate to its directory.

Then, execute the following command to install the projects required modules:

make install

Then, execute the following command to run the project using Djangos built-in web server:

make run

You can then navigate the project at http://localhost:8000/.

Deployment

To install and run the project in production, you must ensure that the following extra prerequisites are fulfilled:

  • you can run an WSGI server with IPv6 support to expose the projects application
  • you can run a web server with IPv6 support to act as a file server for the projects static files, and as a reverse proxy between the WSGI server and the internet

Proceed to deploying this repository, and navigate to its directory.

Then, execute the following command to install the projects static files:

make build

Then, configure and run your WSGI server and your web server.

Hacking

See CONTRIBUTING for developer documentation.