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
if ENVIRONMENT == 'dev': | |
APP_BASE_LINK = 'http://127.0.0.1:5000' | |
DEBUG = True | |
DEBUG_TOOLBAR = True | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': 'chishenma', | |
'HOST': 'localhost', | |
'PORT': '5432', |
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
^CTraceback (most recent call last): | |
File "/Users/michelleglauser/.virtualenvs/venv/bin/envdir", line 8, in <module> | |
load_entry_point('envdir==0.6.1', 'console_scripts', 'envdir')() | |
File "/Users/michelleglauser/.virtualenvs/venv/lib/python2.7/site-packages/envdir/__init__.py", line 14, in run | |
go(runner.run, *args) | |
File "/Users/michelleglauser/.virtualenvs/venv/lib/python2.7/site-packages/envdir/__main__.py", line 12, in go | |
caller(args[0], *args[1:]) | |
File "/Users/michelleglauser/.virtualenvs/venv/lib/python2.7/site-packages/envdir/runner.py", line 123, in run | |
self.terminate() | |
File "/Users/michelleglauser/.virtualenvs/venv/lib/python2.7/site-packages/envdir/runner.py", line 131, in terminate |
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
# Stripe coupons! | |
class StripeCouponView(generic.View): | |
def get(self, request): | |
log.debug(request.GET) | |
coupon_code = request.GET.get('coupon', '') | |
api_url = 'https://api.stripe.com/v1/coupons/' + coupon_code | |
try: | |
r = requests.get(api_url, auth=(settings.STRIPE_SECRET_KEY, '')) | |
r.raise_for_status() |
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
# models.py | |
def subscribe(self, plan, quantity=1, trial_days=None, | |
charge_immediately=True, prorate=djstripe_settings.PRORATION_POLICY, discount_code=None): | |
cu = self.stripe_customer | |
""" | |
Trial_days corresponds to the value specified by the selected plan | |
for the key trial_period_days. | |
""" | |
if ("trial_period_days" in djstripe_settings.PAYMENTS_PLANS[plan]): |
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
class StripeCouponView(generic.View): | |
def get(self, request): | |
stripe.api_key=settings.STRIPE_SECRET_KEY | |
# coupon = stripe.Coupon.retrieve("ZANAFAMILY") | |
# print coupon | |
# log.debug(request.GET) | |
# # Saves the characters after "=" as coupon_code | |
# coupon_code = request.GET.get('coupon', '') | |
if "coupon" in request.GET: | |
coupon_code = request.GET['coupon'] |
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
{% extends "djstripe/base.html" %} | |
{% load static djstripe_tags %} | |
{% block title %}Zana Edge Subscription{% endblock title %} | |
{% block content %} | |
<!-- Modal for server update --> | |
<div class="modal fade" id="in-progress"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> |
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
* what it's like to not be technical in the industry | |
* what you do in tech that people forget is needed | |
* the most interesting thing you've worked on recently | |
* what your day-to-day is like | |
* must-have gifs for every techie | |
* horrible code from the past that shows I'm much better now | |
* the best music for hacking | |
* mistakes you've made that make you groan | |
* how you've made it at well-known companies | |
* self-care in the tech bubble |
OlderNewer