This project template creates a Django 1.8 / 1.9 project with a base set of applications
Installed apps:
- Django 1.8+
- MySQLdb or Psycopg2
- Pillow
- SORL-Thumbnail
- IPython + ptpython
- Raven
- django-analytical
- django-axes
- django-admin-tools
- django-compressor
- django-crispy-forms
- django-debugtools
- django-filebrowser-no-grapelli
- django-fluent-dashboard
- django-ping
Configured URLs:
/robots.txt
/sitemap.xml
/admin/
Templates:
base.html
403.html
404.html
500.html
Features:
- Settings package
- WSGI deployment scripts
- CSS and JavaScript paths configured
- HTML5shiv + jQuery Installed
- Bootstrap 3 based CSS reset
- Gulpfile with SASS + LiveReload setup (can be discarded)
- Uptime monitoring URL (
/api/ping/
)
Create a Django project:
mkdir my-website.com cd my-website.com django-admin.py startproject mywebsite . -e py,rst,example,gitignore --template=https://github.com/edoburu/django-project-template/archive/master.zip
Alternatively, you can place the files in a src
folder too:
mkdir -p my-website.com/src cd my-website.com django-admin.py startproject mywebsite src -e py,rst,example,gitignore --template=https://github.com/edoburu/django-project-template/archive/master.zip
This allows you to create folders like docs
, web
, logs
, etc
at the toplevel.
This setup is recommended.
The remaining instructions - to start the development server - can be found in the generated README.rst
file.
In a second branch, you'll find a project template for the django-fluent CMS:
mkdir my-website.com cd my-website.com django-admin.py startproject mywebsite . -e py,rst,example,gitignore --template=https://github.com/edoburu/django-project-template/archive/django-fluent.zip
As extra treat, the CSS files are easier to edit using SASS. Changes are automatically visible in the browser using LiveReload.
Note
This feature is optional. If you don't like to use it, the project already has a screen.css
file which can be used and edited.
Feel free to remove those files in your own projects or fork (gulpfile.js
, package.json
, and frontend/sass
).
However, we highly recommended to take a look at it.
Describe your project here.
- Python >= 2.7
- pip
- virtualenv (virtualenvwrapper is recommended)
To setup a local development environment:
virtualenv env --prompt="({{ project_name }})" # or mkvirtualenv {{ project_name }} source env/bin/activate pip install -r dev-requirements.txt edit {{ project_name }}/settings/project.py # Enter your DB credentials cp {{ project_name }}/settings/local.py.example {{ project_name }}/settings/local.py # To enable debugging sudo su - postgres createuser {{ project_name }} -P # testtest is the default password createdb --template=template0 --encoding='UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8' --owner={{ project_name }} {{ project_name }} exit ./manage.py migrate ./manage.py runserver
Sass files are compiled to CSS during the development. At the server, there is no need for installing development tools.
To setup your development system, install NodeJS from https://nodejs.org/.
On Mac OSX, you can also use brew install libsass node
.
Run the following command to compile SASS files:
npm run gulp
This will compile the files, and watch for changes. It also has LiveReload support. Install a browser plugin from: http://livereload.com/extensions/ and toggle the "LiveReload" button in the browser to see CSS changes instantly.
Describe project license here.