Skip to main content

A django application for bridging bloxby and your django software supporting User creation, package creation and autologin

Project description

https://badge.fury.io/py/django-bloxby.svg https://travis-ci.org/damey2011/django-bloxby.svg?branch=master https://codecov.io/gh/damey2011/django-bloxby/branch/master/graph/badge.svg

A django application for bridging bloxby and your django software supporting User creation, package creation and autologin

Quickstart

Install Django Bloxby:

pip install django-bloxby

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'bloxby',
    ...
)

The following settings are available to you (in settings.py):

BLOXBY_BUILDER = {
    'url': 'http://clouddigitalmarketing.com',
    'username': 'hello@linkfusions.com',
    'password': 'accountpassword',
    'package_prefix': 'LF-',
    'account_email_prefix': 'LF',
    'public_key': 'Yourpublickeyasstatedinthebloxbyapplicationsettings',
    'autologin_hash': 'Yourautologinhash',
    'default_package_id': 1
}
  • url: This is the base url of the server that hosts the bloxby builder.

  • username: Admin user username

  • password: Password of an admin user

  • package_prefix: This could be empty, but it is used to distinguish packages in case of your builder being accessed by more than one application.

  • account_prefix: Same explanation goes here, in case you have some users shared across your applications.

  • public_key: API key you generated and saved in the admin settings on your bloxby dashboard.

  • autologin_hash: The auto login hash which you as well got from the dashboard.

  • default_package_id: Default package to add for new users being created if none is provided.

Usage

Once the settings are configured you could run requests this way:

from bloxby.functions import Bloxby
b = Bloxby()
# Retrieve User with id of 4
b.Users.retrieve(4)
# Update user with id of 4
b.Users.update(4, last_name='New')
# Create new user
b.Users.create(first_name='John', last_name='Felix', email='jfelix@localhost.com', password=generate_password(), type='User', package_id=5)

# Working with Packages
b.Packages.create(name='New Free Package', sites_number=10,
                  disk_space=100,
                  export_site=True,
                  ftp_publish=True, price=4.00, currency='USD')
# .....
# Could also do .update, .retrieve, .delete with this.

Template

<!-- You could autologin user in html by getting the autologin URL for the current user -->

{% load bloxby %}

<h1>Click <a href="{% user_builder_dashboard %}">here</a> to login to your builder dashboard.

Setup FTP Server

In Production Environment

This part assumes you have python, pip and virtualenv installed globally on your server.

Make setup_ftp_server.sh and start_ftp_server.sh executable if they are not already executable. chmod u+x setup_ftp_server.sh and chmod u+x start_ftp_server.sh.

Run:

./setup_ftp_server.sh

This installs certain dependencies needed

Features

  • TODO

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-bloxby-0.0.20.tar.gz (4.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page