diff --git a/README.md b/README.md index 96f06de..3dd465c 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,15 @@ -Django Simple CMS -================= +# Django Simple CMS -Hello stranger! You have stumbled on my personal Django boilerplate -repository. It contains all those code fragments that I find myself -writing over and over again when I create websites for clients. -There's models for Pages and Sections in the `cms` app, as well as -some basic HTML and CSS designs. There's a NumberedModel in the -`numberedmodel` app. There's simple SASS compiler in `simplesass`. +*A super simple but very extensible content management system for +Django websites.* -With these apps it's very simple to setup a basic website. Simply use -the project template from the `examples` directory as a starting -point. Then run the following Django commands: +This project provides the basic building blocks of *Pages* and +*Sections* and all the views needed to display and edit them. - $ ./manage.py migrate - $ ./manage.py createsuperuser - $ ./manage.py runserver --nostatic +## Installation -(The `--nostatic` argument is needed to make `simplesass` work.) +Use the provided helper command `simplecms` to quickly setup a new +project: -Now point your browser to http://localhost:8000/ and there will be a -website ready to be edited using the CMS views! All you need to do -next is to hire a graphic designer ;-) + pip install https://github.com/rtts/django-simplecms.git + simplecms mysite diff --git a/bin/simplecms b/bin/simplecms new file mode 100755 index 0000000..eabf25c --- /dev/null +++ b/bin/simplecms @@ -0,0 +1,22 @@ +#!/bin/bash -e + +test -z $1 && echo "Please provide a project name!" && exit 1 +test -d $dev/$1 && echo "That project already exists!" && exit 1 + +mkdir $1 && cd $1 +pip3 freeze > requirements.txt +examples_dir=$(python3 -c 'import os,examples;print(os.path.dirname(examples.__file__))') +cp -r $examples_dir/{project,app,manage.py} . +sed -i s/example/$1/ project/settings.py + +# Assume the user has sudo access to postgres +sudo su postgres -c "createuser $1; createdb -O $1 $1" || true + +cat << EOF > .gitignore +*.pyc +__pycache__/ +EOF + +./manage.py migrate +./manage.py createsuperuser +./manage.py runserver --nostatic diff --git a/examples/__init__.py b/examples/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 0ef1f7b..0000000 --- a/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ ---no-binary :all: -Django -django-ckeditor -django-extensions -django-embed-video -django-polymorphic -easy-thumbnails -psycopg2 -libsass -swapper diff --git a/setup.py b/setup.py index d0b691f..db03125 100755 --- a/setup.py +++ b/setup.py @@ -9,11 +9,17 @@ setup( author_email = 'jj@rtts.eu', license = 'GPL3', packages = find_packages(), + scripts = ['bin/simplecms'], include_package_data = True, install_requires = [ 'django', 'django-ckeditor', + 'django-extensions', 'django-embed-video', + 'django-polymorphic', 'easy-thumbnails', + 'psycopg2', + 'libsass', + 'swapper', ], )