Skip to content

Instantly share code, notes, and snippets.

class PluginView(generics.RetrieveAPIView):
serializer_class = PluginSerializer
def get_object(self):
developer = User.objects.get(auth_token=self.request.auth)
return get_object_or_404(Plugin, developer=developer)
<template>
<div @click="click" class="timezone">
<simple-svg
:filepath="'/static/images/timezones-clean-min.svg'"
:width="'100%'"
:height="'100%'"
@ready="selectElement" />
<img class="timezone__map" src="/static/images/map.png">
# Stripe API keys - Production keys to be placed in ENV variable
STRIPE_PUBLIC_KEY = os.environ.get("STRIPE_PUBLIC_KEY", "pk_test_vVq7bqVRXI5vcF7mqKiQN1g3")
STRIPE_SECRET_KEY = os.environ.get("STRIPE_SECRET_KEY", "sk_test_aGWHXGGEJNvfZHTz4AcuABVl")
# Stripe Plan IDs
if DEBUG:
STRIPE_PROJECT_PLAN_ID = 'plan_ClpqLvheKgrYJs'
STRIPE_PROFESSIONAL_PLAN_ID = 'plan_ClpruCuWUAGHwi'
else:
# TODO - create production plans in Stripe
async addMediaToGallery({ commit }, { gallery, file }) {
const formData = new FormData()
formData.append('file', file)
const options = {
headers: { 'Content-Type': 'multipart/form-data' }
}
const response = await this.$axios.$post(
`/api/1.0/gallery/${gallery.id}/add-media/`,
formData,