Coder Social home page Coder Social logo

fileguru's Introduction

Running locally

No special setup required, install requirements and runserver it up! Example with virtualenv:

virtualenv VENV -p python
source VENV/bin/activate
pip install -r requirements.txt
./manage.py runserver

Code formatting and linting

All code has been formatted with black. Imports have been sorted with isort.

There's a format.sh file inside code/ to do those plus autoflake (for unused imports removal) in one shot.

API Authorization

DRF's TokenAuthentication has been set up for the API views (where applicable). You'll have to create a Token inside the admin panel before you can make requests to /upload and /summary.

Token needs to be provided in the standard Authorization: Token <token> way.

Settings

Two app-specific settings have been added to settings.py:

  • UPLOAD_PASSWORD_LENGTH determines how long the autogenerated passphrase for an uploaded resource should be
  • UPLOAD_EXPIRY_HOURS determines after how many hours the upload becomes inaccessible
  • BASE_APP_URL set this to the root URL of wherever the app is deployed to build nice, complete URLs

Commands

A createuser command has been added to help out with creating users for local testing and development.

It takes a username as an argument, and if the optional --email flag is not provided, will use a <username>@example.com address instead.

Asks for password via getpass().

An API token is automatically created and printed, unless --no-token is passed.

Extras

Add a Django system check to see if BASE_APP_URL is configured and warn early about the consequences.

Dependencies

Nothing extra special, apart from freezegun for expiry testing, though it is a bit overkill for this case.

Tests

Nothing special (no pytest, no nose) just ./manage.py test.

There is a .har file which you should be able to import into Insomnia or any other desktop HTTP client for manual API tests.

fileguru's People

Contributors

maligree avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.