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 --no-cache-dir
django-admin startproject demo

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.CosmicUser'
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!

See the demo project at https://bitbucket.org/davidbradleycole/demosemantic/src/master/

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

rm -rf build
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.32.tar.gz (4.7 MB view details)

Uploaded Source

Built Distribution

cosmicdbsemantic-0.0.32-py3-none-any.whl (4.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cosmicdbsemantic-0.0.32.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.5

File hashes

Hashes for cosmicdbsemantic-0.0.32.tar.gz
Algorithm Hash digest
SHA256 6ada53362f41b199b8f6d48003c495159679054721af962440032aaaf5e4bd93
MD5 45317b82b2d20cc8a37a2bce218b3efd
BLAKE2b-256 5274faab9d33ad68748e6be50500785189a3c8dee4824e31c667f612335d2795

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cosmicdbsemantic-0.0.32-py3-none-any.whl
  • Upload date:
  • Size: 4.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.5

File hashes

Hashes for cosmicdbsemantic-0.0.32-py3-none-any.whl
Algorithm Hash digest
SHA256 809bbc990d39b45f5895656b62b2236928da0d7a969563ffd155eee6d4594cdd
MD5 54a67accef8e5c9b92cf2554998d1cc1
BLAKE2b-256 9dae2281c676c50170c5380240a4eb963321770118b861cfd4b6c0723800d5f0

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