New helper command: simplecms

readwriteweb
Jaap Joris Vens 2020-01-02 03:33:41 +01:00
rodzic a69d51a0dc
commit 25350b4706
5 zmienionych plików z 38 dodań i 28 usunięć

Wyświetl plik

@ -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

22
bin/simplecms 100755
Wyświetl plik

@ -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

Wyświetl plik

Wyświetl plik

@ -1,10 +0,0 @@
--no-binary :all:
Django
django-ckeditor
django-extensions
django-embed-video
django-polymorphic
easy-thumbnails
psycopg2
libsass
swapper

Wyświetl plik

@ -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',
],
)