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 '../theme'; | |
import { React, Reapp, View } from 'reapp-kit'; | |
export default Reapp(React.createClass({ | |
styles: { | |
height: '100%' | |
}, | |
render() { | |
return ( |
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 { Bar, React, Reapp, View } from 'reapp-kit'; | |
export default Reapp(React.createClass({ | |
contextTypes: { | |
router: React.PropTypes.func | |
}, | |
getActiveBar() { | |
let currentPath = this.context.router.getCurrentPath(); | |
if (currentPath.indexOf(this.context.router.makePath('shop')) === 0) { |
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
#!/bin/bash | |
PYTHONVER=2.7 | |
PYTHON=python${PYTHONVER} | |
mkdir -p $HOME/{bin,tmp,lib/$PYTHON} | |
easy_install-${PYTHONVER} pip | |
pip2.7 install virtualenv --no-use-wheel | |
pip2.7 install --install-option="--user" virtualenvwrapper --no-use-wheel | |
# Update $HOME/.bashrc with appropriate environment variables | |
echo 'export PATH="$HOME/bin:$PATH"' >> $HOME/.bashrc |
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
ADMINS = ( | |
('Yourname', 'yourname@gmail.com'), | |
) | |
MANAGERS = ADMINS | |
FROM_EMAIL = ADMINS[0][1] | |
EMAIL_SUBJECT_PREFIX = '[dev yourproject] ' | |
EMAIL_HOST = 'smtp.gmail.com' | |
EMAIL_HOST_USER = FROM_EMAIL |
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 django.contrib import admin as django_admin | |
from ratelimitbackend import admin | |
django_admin.autodiscover() | |
for admin_site in django_admin.site._registry.items(): | |
if not admin_site[0] in admin.site._registry: | |
admin.site.register(admin_site[0], admin_site[1].__class__) |
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
function getCSRFToken() { | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = jQuery.trim(cookies[i]); | |
if (cookie.substring(0, 10) == ('csrftoken' + '=')) { | |
cookieValue = decodeURIComponent(cookie.substring(10)); | |
break; | |
} |
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 datetime | |
import md5 | |
from django.contrib.auth.models import User | |
import factory | |
class UserFactory(factory.Factory): | |
""" |
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 django.conf import settings | |
from django.conf.urls.defaults import * | |
from django.conf.urls.static import static | |
from django.contrib.staticfiles.urls import staticfiles_urlpatterns | |
# The next two lines enable the admin and load each admin.py file: | |
from django.contrib import admin | |
admin.autodiscover() | |
urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |
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
# add this soewhere where it gets loaded very early, i.e. | |
# your shop's models.py | |
from django.contrib.auth import login | |
from django.contrib.auth.signals import user_logged_in | |
from django.dispatch import receiver | |
from registration.signals import user_activated | |
from shop.models.defaults.cart import Cart | |