dinoperovic / djangocms-skeletor

๐Ÿ—๏ธ A boilerplate django project with djangoCMS already installed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

djangocms-skeletor

A boilerplate django project with djangoCMS already installed.


Get started

Make make sure you have pipenv installed. Then inside your virtualenv run:

pip install Django
django-admin startproject --template https://github.com/dinoperovic/djangocms-skeletor/archive/master.zip -e py,md,env,json project_name
cd project_name
npm install
pipenv install --dev
pipenv run python manage.py migrate

This project assumes use of Webpack to bundle and manage your static files. To start watching static files with Webpack along with Django development server you can use Honcho which is already installed. Simply run:

honcho start

Both Django and Webpack development servers are configured to run without local host restrictions, which means you can immediately access your site with other devices on the same local network by navigating to http://<local_ip_address>:8000.

Configuration

Settings is managed by the django-configurations project. This allows you to configure the settings using environment variables. For example setting DJANGO_MEDIA_ROOT='/path/to/media' as an environment variable will affect the Django MEDIA_ROOT setting.

The required settings are ENVIRONMENT which is either development, stagging or production. And DJANGO_SECRET_KEY that comes included in .env file when first starting a new project.

Read more about this project on ReadTheDocs.

Dotenv

A python-dotenv project is included to enable setting environment variables through the .env file in your project root. This file will be downloaded when starting a new project but is included in the .gitignore file. It should be unique for each of the enviromnents you install your project in.

Webpack

A basic webpack config is provided to handle common static file types. Out of the box you can start writing SASS/SCSS by importing files in your assets/js/main.js file.

PostCSS is configured to process all CSS files with some default plugins including autoprefixer to handle vendor prefixes automatically. Edit the postcss.config.js file to add and configure more plugins.

Babel compiler is used so that next-gen JavaScript can be used as well.

For seamless integration with Django โ€” django-webpack-loader project is used.

Read more about configuring Webpack.

Deployment

To prepare static files from Webpack for deployment, simply run:

npm run build

This will generate an output in static/bundles/ directory so that it gets included when running collectstatic from Django.

Fabric is included with a blank fabfile.py file.

About

๐Ÿ—๏ธ A boilerplate django project with djangoCMS already installed.


Languages

Language:Python 75.8%Language:JavaScript 14.4%Language:HTML 9.7%