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
Add cosmicdb and requirements to your INSTALLED_APPS setting like this (your app must be first to override)
INSTALLED_APPS = (
'YOURAPPHERE',
'cosmicdb',
'dal',
'dal_select2',
'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!
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
python setup.py sdist bdist_wheel
replace the following line with version number
twine upload dist/cosmicdbsemantic-0.0.1*
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.
Source Distribution
Built Distribution
File details
Details for the file cosmicdbsemantic-0.0.19.tar.gz
.
File metadata
- Download URL: cosmicdbsemantic-0.0.19.tar.gz
- Upload date:
- Size: 4.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf2bf5c2bf23207bc058ec8f85add6e9d56efa792db3e1c5a1424a12ebd4e093 |
|
MD5 | 24015e96026c02ad47711db2309b9a43 |
|
BLAKE2b-256 | 42a0b9b879ce259f3963bd8ab26adf700fde28710353c83ce45d7f362d19eb2f |
File details
Details for the file cosmicdbsemantic-0.0.19-py3-none-any.whl
.
File metadata
- Download URL: cosmicdbsemantic-0.0.19-py3-none-any.whl
- Upload date:
- Size: 5.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | baf11cf1c8d4cd19ffb7799512535099415138d87a04a3d31c20fbcc40c4c985 |
|
MD5 | f924596ac741057e88d24f99dca241d4 |
|
BLAKE2b-256 | 63e3b447c9598f71e25bb82e2706f7733725021c2c747d65ea5ab5e7ded31d45 |