Giter VIP home page Giter VIP logo

pspdfkit-server-example-django's Introduction

PSPDFKit Server Example โ€“ Django

This example shows how to integrate PSPDFKit Server and PSPDFKit for Web into a Django app.

You need to have an activation key for PSPDFKit Server - if you don't have one just request a trial.

Getting Started with Docker

We recommend you use Docker to get all components up and running quickly.

The provided docker-compose.yml and Dockerfile will allow you to edit the example app on your host and it will live-reload.

$ git clone [email protected]:tizz98/pspdfkit-server-example-django.git
$ cd pspdfkit-server-example-django
$ PSPDFKIT_ACTIVATION_KEY=<YOUR_ACTIVATION_KEY> docker-compose up

Make sure to replace <YOUR_ACTIVATION_KEY> with your PSPDFKit Server activation key. You only have to provide the activation key once, after that the server will remain activated until you reset it.

The example app is now running on http://localhost:8000. You can access PSPDFKit Server's dashboard at http://localhost:5000/dashboard using dashboard // secret.

Login using any user name and upload a PDF, then click on the cover image to see PSPDFKit Web in action.

You can also selectively share PDFs with other users you have created.

Resetting the server

You can reset the server by first tearing down its containers and volumes and then recreating them.

$ docker-compose down --volumes
$ PSPDFKIT_ACTIVATION_KEY=<YOUR_ACTIVATION_KEY> docker-compose up

Running the example locally

You can also run the example app directly on your machine, outside of a Docker container.

Prerequisites

Getting Started

$ git clone [email protected]:tizz98/pspdfkit-server-example-django.git
$ cd pspdfkit-server-example-django
$ pipenv install
$ ./manage.py migrate
$ ./manage.py runserver

The example app is now running on http://localhost:8000.

Login using any user name and upload a PDF, then click on the cover image to see PSPDFKit Web in action.

You can also selectively share PDFs with other users you have created.

You can quit the running containers with Ctrl-C.

If you want to test PSPDFKit for Web on different devices in your local network, you need to edit the PSPDFKIT_SERVER_EXTERNAL_URL environment variable in the docker-compose.yml and set it to an address that's reachable from your device.

pspdfkit-server-example-django's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pspdfkit-server-example-django's Issues

Add API

The ruby & node examples expose a simple API for listing, uploading, & sharing documents. This should be a pretty simple issue. The api should use Django rest framework. There will need to be a custom authentication backend since we only check to see if the username exists. This is slightly different than the web auth backend since, if the user doesn't exist for the api request, it should fail authentication.

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.