This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 2, | |
"name": "xxx", | |
"builds": [ | |
{ | |
"src": "package.json", | |
"use": "@now/static-build", | |
"config": { "distDir": "public" } | |
} | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from apps.images.signals import image_callback | |
def entry_upload_path(instance, filename): | |
return os.path.join("uploads", "blog", str(instance.id), filename) | |
class Entry(models.Model): | |
image = FileBrowseUploadField(max_length=250, upload_to=entry_upload_path) | |
post_save.connect(image_callback, sender=Entry) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# PYTHON IMPORTS | |
from django.utils import six | |
from django.core.exceptions import ImproperlyConfigured | |
# REST IMPORTS | |
from rest_framework.settings import api_settings | |
from rest_framework.filters import BaseFilterBackend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
@font-face { | |
font-family: "CustomFont"; | |
src: url(data:font/opentype;charset=utf-8;base64,d09GRgABAAAAAJ2bABAAAAABU8wAAQAAAACanAAAAv8AAAYEAAAAAAAAAABPUy8yAAABbAAAAFgAAABgZpABsVZETVgAAAHEAAADfgAABeBvK3avY21hcAAABUQAAACpAAAA5LmCs2VjdnQgAAAF8AAAACAAAAAgBLgBVWZwZ20AAAYQAAABAgAAAXMGWZw3Z2FzcAAABxQAAAAIAAAACP//AARnbHlmAAAHHAAAcCsAAPo4D+TPemhlYWQAAHdIAAAANgAAADbxqmcSaGhlYQAAd4AAAAAgAAAAJAb8BA1obXR4AAB3oAAAAiEAAAO0yak2cGtlcm4AAHnEAAAWlQAANFya657HbG9jYQAAkFwAAAKHAAADuACGVGBtYXhwAACS5AAAACAAAAAgAwYEuG5hbWUAAJMEAAAG9QAAEp6VPrU+cG9zdAAAmfwAAAATAAAAIP+4ADJwcmVwAACaEAAAAIoAAADBPju7qXicY2Bm/MI4gYGVgYNpD1MXAwNDD4RmvMtgxPCLgYGJn5WZiYmZlYm5gYFhPVCeiwEKfDz9/IEUr6IS08v/jAwnmKcxXAHyGUFyjE+Y1jIoACEDAAaCD5t4nB3NU3AeChCG4bdXJ7Vt27Zt27Zt27Zt2z1F7MZO2qRu0zZN0+75zr8788w7sxdLKrT/D+lIcjKc+Mf+khonmYbUMi1p7I+uadXpSafOQHqZkQwyExllZjJZClnIrM4qU8hGFpmdrPabHGRT5yS7Ohc5ZG5yyjzksmTyklvmI4/MT15ZgHz2i4IymULkVxemgCxCQVmUQrIYhS2J4hSRJSgqS1JMlqK4/aQ0JdRlKKku67AcpWR5SssKlLEfVKSsu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from urlparse import urlparse | |
from django.conf import settings | |
from django.test import TestCase | |
from django.test.client import FakePayload, Client | |
class TestApiClient(object): | |
def __init__(self): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tasks import full_export_task | |
def export_year_zip(user): | |
full_export_task.update_state(state="PROGRESS", meta={}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _walk(self, path, filelisting): | |
""" | |
Recursively walks the path and collects all files and | |
directories. | |
Danger: Symbolic links can create cycles and this function | |
ends up in a regression. | |
""" | |
dirs, files = self.site.storage.listdir(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from filebrowser.sites import site | |
from django.core.files.storage import DefaultStorage, default_storage, FileSystemStorage | |
site_1 = site(name="First FB Site", app_name="filebrowser", storage=default_storage) # default filebrowser site | |
site_2 = site(name="Second FB Site", app_name="filebrowser", storage=FileSystemStorage) |
NewerOlder