Skip to main content

An easy way to setup a database site.

Project description

CosmicDBSemantic Django App

Install

virtualenv demoenv --no-site-packages
demoenv\Scripts\activate
pip install cosmicdbsemantic
django-admin startproject demo

Usage

Add cosmicdb and requirements to your INSTALLED_APPS setting like this (your app must be first to override)

INSTALLED_APPS = (
    'YOURAPPHERE',
    'cosmicdb',
    'crispy_forms',
    'sitetree',
    'django_tables2',
    ... (rest of django apps)
)

Add cosmicdb.urls to your urls.py like this (put cosmicdb urls last)

from django.contrib import admin
from django.urls import path, re_path, include

urlpatterns = [
    re_path(r'^', include('cosmicdb.urls')),
    path('admin/', admin.site.urls),
]

Add cosmicdb settings to your settings.py like this

LANGUAGE_CODE = 'en-au'
COSMICDB_SITE_TITLE = 'Demo Site'
CRISPY_TEMPLATE_PACK = 'semanticui'
CRISPY_ALLOWED_TEMPLATE_PACKS = (CRISPY_TEMPLATE_PACK)
DJANGO_TABLES2_TEMPLATE = 'django_tables2/semantic.html'
COSMICDB_ALLOW_SIGNUP = True
AUTH_USER_MODEL = 'cosmicdb.User'
LOGIN_URL = '/login/'
EMAIL_USE_TLS = True
EMAIL_HOST = 'mysmtp.smtp.com'
EMAIL_PORT = 465
EMAIL_HOST_USER = 'mysmtpuser'
EMAIL_HOST_PASSWORD = 'mysmtppw'
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
DEFAULT_FROM_EMAIL_NAME = COSMICDB_SITE_TITLE
SITETREE_MODEL_TREE = 'cosmicdb.CosmicDBTree'
SITETREE_MODEL_TREE_ITEM = 'cosmicdb.CosmicDBTreeItem'

Run

python manage.py migrate
python manage.py collectstatic
python manage.py createsuperuser

Load sitetree from site-packages for now

python manage.py sitetreeload SITE_PACKAGES_DIR/cosmicdb/treedump.json

Installation Complete!

Optional

Custom Semantic UI Themes

NodeJS (npm)

Gulp

npm install -g gulp
npm install -g gulp-cli

Add NODE_PATH env

Semantic UI

cd PROJECT_DIR\cosmicdb\res\
npm install semantic-ui --save

Put semanticui in semantic

cd semantic/
gulp build

Now you can copy your own theme from dist to cosmicdb\static\

cd PROJECT ROOT
cp -rf cosmicdb/res/semanticui/semantic/dist cosmicdb/static/cosmicdb/semantic

Site Tree

Generate sitetree

python manage.py sitetreedump > treedump.json

Dev Notes

adjust cosmicdb/init.py for version number

python setup.py sdist bdist_wheel

replace the following line with version number

twine upload dist/cosmicdbsemantic-0.0.1*

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

cosmicdbsemantic-0.0.8.tar.gz (4.6 MB view details)

Uploaded Source

Built Distribution

cosmicdbsemantic-0.0.8-py3-none-any.whl (4.8 MB view details)

Uploaded Python 3

File details

Details for the file cosmicdbsemantic-0.0.8.tar.gz.

File metadata

File hashes

Hashes for cosmicdbsemantic-0.0.8.tar.gz
Algorithm Hash digest
SHA256 0d17ce3c4ae8b4975a4087567cf8a6b85331fec05de0ee012497ea948ab6edd4
MD5 14b2a2fc54a63455b983e1648bb54021
BLAKE2b-256 18c0830cc5e3255bd867647fb340d55bbdbe7d216f6359269fedcd341020a307

See more details on using hashes here.

File details

Details for the file cosmicdbsemantic-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for cosmicdbsemantic-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f9f72cc6a18dba5e32a564c0c89b25b6780181b0f7ad4fe6fd1bf7982ea8255a
MD5 c5fda184e27ac3df5d1270c2b0c08012
BLAKE2b-256 78e4ab24c29d4cdd7c1e26bf8adbcfcc4b08fe1c1b4b8252cc43b138ce64b57e

See more details on using hashes here.

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