mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-06 22:14:12 +00:00
nem sei pq tantos arquivos
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,275 @@
|
||||
Metadata-Version: 2.3
|
||||
Name: django-pwa
|
||||
Version: 2.0.1
|
||||
Summary: A Django app to include a manifest.json and Service Worker instance to enable progressive web app behavior
|
||||
Project-URL: Repository, http://github.com/silviolleite/django-pwa
|
||||
Author-email: Silvio Luis <silviolleite@gmail.com>
|
||||
Maintainer-email: Christian Hartung <hartungstenio@outlook.com>
|
||||
License: MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Scott Vitale, Silvio Luis and Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
License-File: LICENSE
|
||||
Classifier: Environment :: Web Environment
|
||||
Classifier: Framework :: Django
|
||||
Classifier: Framework :: Django :: 3.2
|
||||
Classifier: Framework :: Django :: 4.0
|
||||
Classifier: Framework :: Django :: 4.1
|
||||
Classifier: Framework :: Django :: 4.2
|
||||
Classifier: Framework :: Django :: 5.0
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3.8
|
||||
Classifier: Programming Language :: Python :: 3.9
|
||||
Classifier: Programming Language :: Python :: 3.10
|
||||
Classifier: Programming Language :: Python :: 3.11
|
||||
Classifier: Programming Language :: Python :: 3.12
|
||||
Classifier: Topic :: Internet :: WWW/HTTP
|
||||
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
||||
Requires-Python: >=3.8
|
||||
Requires-Dist: django>=3.2
|
||||
Description-Content-Type: text/markdown
|
||||
|
||||
django-pwa
|
||||
=====
|
||||
[](https://travis-ci.org/silviolleite/django-pwa)
|
||||
[](https://codeclimate.com/github/silviolleite/django-pwa/maintainability)
|
||||
[](https://codecov.io/gh/silviolleite/django-pwa)
|
||||
[](https://pypi.org/project/django-pwa/)
|
||||
[](https://pypi.org/project/django-pwa)
|
||||
[](https://pypi.org/project/django-pwa)
|
||||
|
||||
This Django app turns your project into a [progressive web app](https://developers.google.com/web/progressive-web-apps/). Navigating to your site on an Android phone will prompt you to add the app to your home screen.
|
||||
|
||||

|
||||
|
||||
Launching the app from your home screen will display your app [without browser chrome](https://github.com/silviolleite/django-pwa/raw/master/images/screenshot2.png). As such, it's critical that your application provides all navigation within the HTML (no reliance on the browser back or forward button).
|
||||
|
||||
Requirements
|
||||
=====
|
||||
Progressive Web Apps require HTTPS unless being served from localhost. If you're not already using HTTPS on your site, check out [Let's Encrypt](https://letsencrypt.org/) and [ZeroSSL](https://zerossl.com/).
|
||||
|
||||
Installation
|
||||
=====
|
||||
Install from PyPI:
|
||||
|
||||
```
|
||||
pip install django-pwa
|
||||
```
|
||||
|
||||
Configuration
|
||||
=====
|
||||
Add `pwa` to your list of `INSTALLED_APPS` in settings.py:
|
||||
|
||||
```python
|
||||
INSTALLED_APPS = [
|
||||
...
|
||||
'pwa',
|
||||
...
|
||||
]
|
||||
```
|
||||
Define STATICFILES_DIRS for your custom PWA_APP_ICONS
|
||||
```python
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, 'static'),
|
||||
]
|
||||
```
|
||||
|
||||
Configure your app name, description, icons, splash screen images, screenshots and shortcuts in settings.py:
|
||||
```python
|
||||
|
||||
PWA_APP_NAME = 'My App'
|
||||
PWA_APP_DESCRIPTION = "My app description"
|
||||
PWA_APP_THEME_COLOR = '#0A0302'
|
||||
PWA_APP_BACKGROUND_COLOR = '#ffffff'
|
||||
PWA_APP_DISPLAY = 'standalone'
|
||||
PWA_APP_SCOPE = '/'
|
||||
PWA_APP_ORIENTATION = 'any'
|
||||
PWA_APP_START_URL = '/'
|
||||
PWA_APP_STATUS_BAR_COLOR = 'default'
|
||||
PWA_APP_ICONS = [
|
||||
{
|
||||
'src': '/static/images/my_app_icon.png',
|
||||
'sizes': '160x160'
|
||||
}
|
||||
]
|
||||
PWA_APP_ICONS_APPLE = [
|
||||
{
|
||||
'src': '/static/images/my_apple_icon.png',
|
||||
'sizes': '160x160'
|
||||
}
|
||||
]
|
||||
PWA_APP_SPLASH_SCREEN = [
|
||||
{
|
||||
'src': '/static/images/icons/splash-640x1136.png',
|
||||
'media': '(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)'
|
||||
}
|
||||
]
|
||||
PWA_APP_DIR = 'ltr'
|
||||
PWA_APP_LANG = 'en-US'
|
||||
PWA_APP_SHORTCUTS = [
|
||||
{
|
||||
'name': 'Shortcut',
|
||||
'url': '/target',
|
||||
'description': 'Shortcut to a page in my application'
|
||||
}
|
||||
]
|
||||
PWA_APP_SCREENSHOTS = [
|
||||
{
|
||||
'src': '/static/images/icons/splash-750x1334.png',
|
||||
'sizes': '750x1334',
|
||||
"type": "image/png"
|
||||
}
|
||||
]
|
||||
|
||||
```
|
||||
#### Show console.log
|
||||
Set the `PWA_APP_DEBUG_MODE = False` to disable the the `console.log` on browser.
|
||||
|
||||
All settings are optional, and the app will work fine with its internal defaults. Highly recommend setting at least `PWA_APP_NAME`, `PWA_APP_DESCRIPTION`, `PWA_APP_ICONS` and `PWA_APP_SPLASH_SCREEN`.
|
||||
In order to not use one of the internal defaults, a setting can be set to an empty string or list, whichever one is applicable.
|
||||
|
||||
Add the progressive web app URLs to urls.py:
|
||||
```python
|
||||
from django.urls import url, include
|
||||
|
||||
urlpatterns = [
|
||||
...
|
||||
url('', include('pwa.urls')), # You MUST use an empty string as the URL prefix
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
Inject the required meta tags in your base.html (or wherever your HTML <head> is defined):
|
||||
```html
|
||||
{% load pwa %}
|
||||
|
||||
<head>
|
||||
...
|
||||
{% progressive_web_app_meta %}
|
||||
...
|
||||
</head>
|
||||
```
|
||||
|
||||
Troubleshooting
|
||||
=====
|
||||
While running the Django test server:
|
||||
|
||||
1. Verify that `/manifest.json` is being served
|
||||
2. Verify that `/serviceworker.js` is being served
|
||||
3. Verify that `/offline` is being served
|
||||
4. Use the Application tab in the Chrome Developer Tools to verify the progressive web app is configured correctly.
|
||||
5. Use the "Add to homescreen" link on the Application Tab to verify you can add the app successfully.
|
||||
|
||||
|
||||
The Service Worker
|
||||
=====
|
||||
By default, the service worker implemented by this app is:
|
||||
```js
|
||||
// Base Service Worker implementation. To use your own Service Worker, set the PWA_SERVICE_WORKER_PATH variable in settings.py
|
||||
|
||||
var staticCacheName = "django-pwa-v" + new Date().getTime();
|
||||
var filesToCache = [
|
||||
'/offline',
|
||||
'/css/django-pwa-app.css',
|
||||
'/images/icons/icon-72x72.png',
|
||||
'/images/icons/icon-96x96.png',
|
||||
'/images/icons/icon-128x128.png',
|
||||
'/images/icons/icon-144x144.png',
|
||||
'/images/icons/icon-152x152.png',
|
||||
'/images/icons/icon-192x192.png',
|
||||
'/images/icons/icon-384x384.png',
|
||||
'/images/icons/icon-512x512.png',
|
||||
'/static/images/icons/splash-640x1136.png',
|
||||
'/static/images/icons/splash-750x1334.png',
|
||||
'/static/images/icons/splash-1242x2208.png',
|
||||
'/static/images/icons/splash-1125x2436.png',
|
||||
'/static/images/icons/splash-828x1792.png',
|
||||
'/static/images/icons/splash-1242x2688.png',
|
||||
'/static/images/icons/splash-1536x2048.png',
|
||||
'/static/images/icons/splash-1668x2224.png',
|
||||
'/static/images/icons/splash-1668x2388.png',
|
||||
'/static/images/icons/splash-2048x2732.png'
|
||||
];
|
||||
|
||||
// Cache on install
|
||||
self.addEventListener("install", event => {
|
||||
this.skipWaiting();
|
||||
event.waitUntil(
|
||||
caches.open(staticCacheName)
|
||||
.then(cache => {
|
||||
return cache.addAll(filesToCache);
|
||||
})
|
||||
)
|
||||
});
|
||||
|
||||
// Clear cache on activate
|
||||
self.addEventListener('activate', event => {
|
||||
event.waitUntil(
|
||||
caches.keys().then(cacheNames => {
|
||||
return Promise.all(
|
||||
cacheNames
|
||||
.filter(cacheName => (cacheName.startsWith("django-pwa-")))
|
||||
.filter(cacheName => (cacheName !== staticCacheName))
|
||||
.map(cacheName => caches.delete(cacheName))
|
||||
);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
// Serve from Cache
|
||||
self.addEventListener("fetch", event => {
|
||||
event.respondWith(
|
||||
caches.match(event.request)
|
||||
.then(response => {
|
||||
return response || fetch(event.request);
|
||||
})
|
||||
.catch(() => {
|
||||
return caches.match('offline');
|
||||
})
|
||||
)
|
||||
});
|
||||
```
|
||||
|
||||
Adding Your Own Service Worker
|
||||
=====
|
||||
To add service worker functionality, you'll want to create a `serviceworker.js` or similarly named template in a template directory, and then point at it using the PWA_SERVICE_WORKER_PATH variable (PWA_APP_FETCH_URL is passed through).
|
||||
|
||||
```python
|
||||
PWA_SERVICE_WORKER_PATH = os.path.join(BASE_DIR, 'my_app', 'serviceworker.js')
|
||||
|
||||
```
|
||||
|
||||
The offline view
|
||||
=====
|
||||
By default, the offline view is implemented in `templates/offline.html`
|
||||
You can overwrite it in a template directory if you continue using the default `serviceworker.js`.
|
||||
|
||||
|
||||
Feedback
|
||||
=====
|
||||
I welcome your feedback and pull requests. Enjoy!
|
||||
|
||||
License
|
||||
=====
|
||||
All files in this repository are distributed under the MIT license.
|
||||
@@ -0,0 +1,49 @@
|
||||
django_pwa-2.0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
django_pwa-2.0.1.dist-info/METADATA,sha256=ISE2fpDbCTgoOUzBFSzcxODk5K51ie-nfVFlSUTeBPc,9885
|
||||
django_pwa-2.0.1.dist-info/RECORD,,
|
||||
django_pwa-2.0.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
django_pwa-2.0.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
||||
django_pwa-2.0.1.dist-info/licenses/LICENSE,sha256=yYDcgK-HiXaa6o3NojUBv6WgnbSibPxWGBNGfxyPYis,1105
|
||||
pwa/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pwa/__pycache__/__init__.cpython-310.pyc,,
|
||||
pwa/__pycache__/app_settings.cpython-310.pyc,,
|
||||
pwa/__pycache__/apps.cpython-310.pyc,,
|
||||
pwa/__pycache__/urls.cpython-310.pyc,,
|
||||
pwa/__pycache__/views.cpython-310.pyc,,
|
||||
pwa/app_settings.py,sha256=BfoXQO5W3B3t2g1Wy0dRXNk5bBUr_CDWVA41xrHLD3c,4712
|
||||
pwa/apps.py,sha256=iHOv7tkAmAN6v8cg6cCZk734gNxWKtqENUwgd2YbgG0,81
|
||||
pwa/static/css/django-pwa-app.css,sha256=PDZ_MhG6yxGu_Ymxz9_foRv9lPNkY1DbjPzgnpTQ1VI,116158
|
||||
pwa/static/fonts/bootstrap/glyphicons-halflings-regular.eot,sha256=E2NNqH2eI_jD7ZEIzhck0YOjmtBy5z4bPYy_ZG0tBAc,20127
|
||||
pwa/static/fonts/bootstrap/glyphicons-halflings-regular.svg,sha256=2A6hAfGjSEkUasGP2v2vdGuATNCAxBf2WpzM0bXk8w4,108737
|
||||
pwa/static/fonts/bootstrap/glyphicons-halflings-regular.ttf,sha256=45UEQJN1fYKvyxOJV9BqHqk2G9zwtELQahioBRr1dFY,45404
|
||||
pwa/static/fonts/bootstrap/glyphicons-halflings-regular.woff,sha256=omOU9-3hAMoRjv8u2ghZYnWpg5uVnCJuFUOVV6WoB0I,23424
|
||||
pwa/static/fonts/bootstrap/glyphicons-halflings-regular.woff2,sha256=_hhdEaSWdokNR7t4MxKgzaWkTEA5IUCU55V7TAQO8Rw,18028
|
||||
pwa/static/images/icons/Thumbs.db,sha256=rgJJWTsLONNb6saUcWQQHlrtajOZZap8lmWdxnkGpBw,76288
|
||||
pwa/static/images/icons/icon-128x128.png,sha256=Ri0POfYnR4LDrYwHNav8AUlKpy8ot6ucrJDUMAEuxj4,6754
|
||||
pwa/static/images/icons/icon-144x144.png,sha256=ZW-fm1mhJqlfDeJmmSP-5G56ZlimlIiluhdELbVdJoY,7672
|
||||
pwa/static/images/icons/icon-152x152.png,sha256=Sir803xVBXJzVfS_0maz6A8ckhpBDv3Gd3RQhZ-nl8I,8134
|
||||
pwa/static/images/icons/icon-192x192.png,sha256=1Fj9NS0DZOEjX-E3FxqmZ83w2cMeUyXzT0O5kP5gHQI,10580
|
||||
pwa/static/images/icons/icon-384x384.png,sha256=OaOvQxOsM01ZVPowVZ9lYkeX1AJrGGiJPOZx9e2rea0,24415
|
||||
pwa/static/images/icons/icon-512x512.png,sha256=GCRzC7VC1_AMbpV9wJH-cmH_LdzHGgwTz03YJf0EWs8,22508
|
||||
pwa/static/images/icons/icon-72x72.png,sha256=5Ecee0qAyZV-u0zceXBoA2DRUWquB4goOP_s-3OAY0w,3252
|
||||
pwa/static/images/icons/icon-96x96.png,sha256=nJGAnztCaWRkhuLzL5ci-68WAHRXvmj0uIbUFEvzjsQ,4693
|
||||
pwa/static/images/icons/splash-1125x2436.png,sha256=FnPMbkgc9pWrmZVchFQ4X7ziyUYxt2Uq98x3S96GSl0,36047
|
||||
pwa/static/images/icons/splash-1242x2208.png,sha256=A_uc9O2Jv3ki4vkDZ2mu_mQ_IoaHpE1p1Sg1uzas9uU,30134
|
||||
pwa/static/images/icons/splash-1242x2688.png,sha256=cBamXXHsn7zcCEWhg-suu-JuHT8D6O1FkSTfgm_ShAw,33765
|
||||
pwa/static/images/icons/splash-1536x2048.png,sha256=9RiE2U-mQrwWqsnYemqx5SFs2qc1Livt3AJeH7myGMg,31551
|
||||
pwa/static/images/icons/splash-1668x2224.png,sha256=9QdkCe_vpSr8wsLc8OFw5FTlLYIpVPFgm66QgAqqWKc,34491
|
||||
pwa/static/images/icons/splash-1668x2388.png,sha256=AkX-MbBFQbJI-B6v7uVB6kP-M2osRwAj5hpr133MH4Q,35903
|
||||
pwa/static/images/icons/splash-2048x2732.png,sha256=JDfkkTJuZ7Xmjm43AaPqL_LOragxfDk2dxARbRZ8WMc,43341
|
||||
pwa/static/images/icons/splash-640x1136.png,sha256=vjk_tPUHLSHPGAyp5PdstcUkcuazpwv7qRiyF9K76SE,19254
|
||||
pwa/static/images/icons/splash-750x1334.png,sha256=ObaMp62i2lHlZ_kYq-mBrd5O4RMy96JqIfsDAfnNtvA,20970
|
||||
pwa/static/images/icons/splash-828x1792.png,sha256=AZpR9Kg9cgQiXdGtdTa9DMdPhVCeh7qAtiAtzrdAatM,24221
|
||||
pwa/templates/manifest.json,sha256=G47XzduUwuIrR5DgSeuquYLOV4JxcJ7CxlyufxJptIw,645
|
||||
pwa/templates/offline.html,sha256=JccdCcXZvQ7ZiqqRExg6cocAUjL8XGzfr9Ji2Bktpi0,290
|
||||
pwa/templates/pwa.html,sha256=jczQFJ9q28tXMhK9n68Kfp5G9EtmmXcppjxay804vMQ,2089
|
||||
pwa/templates/serviceworker.js,sha256=qeeOkGMiYZvsaMA5r5GHuBk1hKEUJ2FRu5DD3Ig2wmU,2142
|
||||
pwa/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
pwa/templatetags/__pycache__/__init__.cpython-310.pyc,,
|
||||
pwa/templatetags/__pycache__/pwa.cpython-310.pyc,,
|
||||
pwa/templatetags/pwa.py,sha256=FQX1ziBislNwoLQa0B9_CoJFwfOfZdXwxdnnMggzP94,736
|
||||
pwa/urls.py,sha256=THpVfpUIiilE9vu3IkTlEcaZF9owjKAvUsaM9FwWIao,352
|
||||
pwa/views.py,sha256=_J8yy_Eh3yCljGC50a8QAge9ASdaJDemuG-K2PsKrtg,732
|
||||
@@ -0,0 +1,4 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: hatchling 1.25.0
|
||||
Root-Is-Purelib: true
|
||||
Tag: py3-none-any
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Scott Vitale, Silvio Luis and Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Reference in New Issue
Block a user