1. File upload
- current open file
- right click in sidebar, on file
- enter file path manually
Screenshots:
2. API errors (example: 'invalid_auth') are sent to user with an alert.
from django.contrib.auth.tokens import default_token_generator
from django.utils.http import urlsafe_base64_encode
from django.utils.encoding import force_bytes
from django.db.models.signals import post_save
post_save.connect(user_saved, User)
def user_saved(sender, instance, created, *args, **kwargs):
if created:
context = {
'token': default_token_generator.make_token(instance),
'uid': urlsafe_base64_encode(force_bytes(instance.pk)),
'user': instance,
}
# here, send an email with this context
{% url 'password_reset_confirm' uidb64=uid token=token %}
urlpatterns += patterns(
'django.contrib.auth.views',
url(r'^password-change/done/$', 'password_change_done', name='password_change_done'),
url(r'^password-reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
'password_reset_confirm',
name='password_reset_confirm'),
url(r'^password-reset/done/$',
'password_reset_done',
name='password_reset_done'),
url(r'^password-reset/complete/$',
'password_reset_complete',
name='password_reset_complete'),
)
def live():
global PATH, ENV_PATH
env.hosts = ["22.2.222.2"]
env.user = 'test'
PATH = '/path/to/project'
# optional, is using virtualenv
ENV_PATH = '/path/to/virtualenv'
# overwrite whatever variabled you need to change on the current machine
def staging():
global PATH, ENV_PATH
env.hosts = ["11.1.11.1"]
env.user = 'test2'
PATH = '/path/to/project/on/second/machine'
# optional, is using virtualenv
ENV_PATH = '/path/to/virtualenv'
# overwrite whatever variabled you need to change on the current machine
def deploy():
with cd(PATH), virtualenv(ENV_PATH):
run('uber command')
run('another uber command')
#deploy on staging
fab staging deploy
# deploy on live
fab live deploy