All Projects → pastpages → Django Urlarchivefield

pastpages / Django Urlarchivefield

Licence: other
A custom Django model field that automatically archives a URL

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Urlarchivefield

Cmdb
CMDB 配置管理系统 资产管理系统
Stars: ✭ 747 (+14840%)
Mutual labels:  django
Imooc Django
高仿慕课网:py3.5 + Django1.10 + xadmin 搭建的在线课程教育平台
Stars: ✭ 774 (+15380%)
Mutual labels:  django
Booktype
Booktype is a free, open source platform that produces beautiful, engaging books formatted for print, Amazon, iBooks and almost any ereader within minutes.
Stars: ✭ 810 (+16100%)
Mutual labels:  django
Izone
django+bootstrap4 个人博客
Stars: ✭ 757 (+15040%)
Mutual labels:  django
Django Admin Honeypot
🍯 A fake Django admin login screen page.
Stars: ✭ 768 (+15260%)
Mutual labels:  django
Django Admin Bootstrap
Responsive Theme for Django Admin With Sidebar Menu
Stars: ✭ 787 (+15640%)
Mutual labels:  django
Django Recaptcha
Django reCAPTCHA form field/widget integration app.
Stars: ✭ 742 (+14740%)
Mutual labels:  django
Django Registration
Django-registration (redux) provides user registration functionality for Django websites.
Stars: ✭ 823 (+16360%)
Mutual labels:  django
Edge
A Django project skeleton that is modern and cutting edge.
Stars: ✭ 773 (+15360%)
Mutual labels:  django
Django Rosetta
Rosetta is a Django application that eases the translation process of your Django projects
Stars: ✭ 806 (+16020%)
Mutual labels:  django
Eventsourcing
A library for event sourcing in Python.
Stars: ✭ 760 (+15100%)
Mutual labels:  django
Try Django
Learn Django bit by bit in this series
Stars: ✭ 767 (+15240%)
Mutual labels:  django
Django Cachalot
No effort, no worry, maximum performance.
Stars: ✭ 790 (+15700%)
Mutual labels:  django
Promgen
Promgen is a configuration file generator for Prometheus
Stars: ✭ 754 (+14980%)
Mutual labels:  django
Django Organizations
👫 Multi-user accounts for Django projects
Stars: ✭ 813 (+16160%)
Mutual labels:  django
Mixer
Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.
Stars: ✭ 743 (+14760%)
Mutual labels:  django
Funpyspidersearchengine
Word2vec 千人千面 个性化搜索 + Scrapy2.3.0(爬取数据) + ElasticSearch7.9.1(存储数据并提供对外Restful API) + Django3.1.1 搜索
Stars: ✭ 782 (+15540%)
Mutual labels:  django
Django Prometheus
Export Django monitoring metrics for Prometheus.io
Stars: ✭ 823 (+16360%)
Mutual labels:  django
Social Network Harvester V1.0
Stars: ✭ 5 (+0%)
Mutual labels:  django
Django Summernote
Simply integrate Summernote editor with Django project.
Stars: ✭ 797 (+15840%)
Mutual labels:  django

django-urlarchivefield

A custom Django model field that automatically archives a URL

Build Status PyPI version Coverage Status

Getting started

Install this library from the Python Package Index.

$ pip install django-urlarchivefield

Add it to one of your models.

from django.db import models
from urlarchivefield.fields import URLArchiveField

class MyModel(models.Model):
    archive = URLArchiveField(upload_to="my_archive")

Saving an URL's HTML content to your storage backend becomes this easy.

>>> obj = MyModel.objects.create(archive="http://www.latimes.com")
>>> # You can do it this way too
>>> obj = MyModel()
>>> obj.archive = "http://www.latimes.com"
>>> obj.save()

The field attribute now has all the typical qualities of a Django FileField with a few additions.

# Return the URL that was originally submitted for archival
>>> obj.archive.archive_url
# Return the timestamp when the archive was created
>>> obj.archive.archive_timestamp
# Return the HTML from the archive
>>> obj.archive.archive_html

By default, the data are compressed before being saved by gzip. If you'd rather store the raw HTML set the compress keyword argument on the field.

class MyModel(models.Model):
    archive = URLArchiveField(upload_to="my_archive", compress=False)

Credits

This is a joint project of PastPages.org, The Reynolds Journalism Institute and the University of Missouri.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].