NDA
For this task I've chosen Django Python Web framework that encourages rapid development and clean, pragmatic design.
And "tox" to automate and standardize testing in Python. It is part of a larger vision of easing the packaging, testing and release process of Python software.
- Python 3.7.1
- pip
- tox (https://tox.readthedocs.io/en/latest/)
-
First, install tox with
pip install tox
-
Launch the development server:
tox -e runserver
Tox will install all requirements into private python virtualenv
-
By default Web server listen on http://127.0.0.1:9000
The unit and functioning tests are located under the tests/ directory. To execute it, just type: tox
URL data model consists with following fields:
- target - saves the target address;
- tiny - saves the "shortener" address;
- created - datatime when record's created. Default current;
- usage_count - how many time this record was called
- SHORT_URL_MIN_LENGTH - settings control the lengths (and bruteforce attack complexity at whole) of the tiny URL
- SHORT_URL_MAX_LENGTH_SCALING - settings control the hash windows scaling
-
Ipv6 URLs is not full supported
-
target and tiny URLs max_lengths has strict limit up to 2048 symbols because some browsers have a "Address bar" length limit:
Browser Address bar document.location or anchor tag ------------------------------------------ Chrome 32779 >64k Android 8192 >64k Firefox >64k >64k Safari >64k >64k IE11 2047 5120 Edge 16 2047 10240
-
Cleanup/Records expiration functionality haven't implemented