Skip to main content

Accessing camera on Django Webframework

Project description

djangocamera

A library that makes it simple to use one function to integrate a camera with the Django framework on a website.

Installation

Use the package manager pip to install foobar.

pip install djangocamera

Usage

The views.py file, in the app directory:

from django.shortcuts import render

from djangocamera.streaming import video_feed



# returns 'camera video'

def camera(request):

  return video_feed()



def index(request):

  return render(request,"index.html",{})

The urls.py file, in the app directory:

from django.urls import path

from . import views



urlpatterns = [

    path("camera/",views.camera,name="camera"),

    path("",views.index,name="index"),

]

The index.html file, in the templates directory:

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

</head>

<body>

    <img src="{% url 'camera' %}" alt="#" >

</body>

</html>

Contributing

Pull requests are welcome. For major changes, please open an issue first

to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangocamera-0.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

djangocamera-0.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file djangocamera-0.0.1.tar.gz.

File metadata

  • Download URL: djangocamera-0.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.1

File hashes

Hashes for djangocamera-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c1b6be019259cf40a8f67a3271186a4e6c18a371b2c9d2ea1fb5aaf1a957f8d9
MD5 b1846d839dec4dd4646cb43dd6a6bd7d
BLAKE2b-256 ab47bda3d7f847af0811699fceb6bf21261205796ad3d7ab3e2679b2a6f02e78

See more details on using hashes here.

Provenance

File details

Details for the file djangocamera-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for djangocamera-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3047c3744499b2f85bdebe216682d2a03ebb4dfce38259b7b0f463c120243496
MD5 db515247950f10cd19bd4d314ca66d63
BLAKE2b-256 ed8b9e814293df42071d898e7f3ae49c92dc5f80583edc245fa77d1b864dedf0

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page