A django application for bridging bloxby and your django software supporting User creation, package creation and autologin
Project description
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.
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:
History
0.0.1 (2020-04-07)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.