https://github.com/openpolis/django-project-template
A cookiecuter template for django >1.6
https://github.com/openpolis/django-project-template
Last synced: 11 months ago
JSON representation
A cookiecuter template for django >1.6
- Host: GitHub
- URL: https://github.com/openpolis/django-project-template
- Owner: openpolis
- Created: 2014-06-04T12:55:17.000Z (about 12 years ago)
- Default Branch: django111
- Last Pushed: 2017-10-06T09:31:49.000Z (over 8 years ago)
- Last Synced: 2025-03-09T21:20:13.460Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 61.5 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Django-project-template
=======================
A `cookiecutter`_ template for Django.
Version: 0.1
Features
--------
* Python 2.7, 3.4 or 3.5
* Django 1.11
* Use `cookiecutter`_ to build new project
* django-environ (config/.env)
* django-braces
* django-model-utils
* django-extensions
* two-scoops like settings (package with `development.py`, `production.py` and `test.py`)
* django-debug-toolbar (only `development.py`)
* docs with Sphinx
* tests with Selenium and coverage
Usage
-----
To build new project:
.. code-block:: bash
pip install cookiecutter
cookiecutter https://github.com/openpolis/django-project-template.git
# use option --checkout for specific branch (django16, django17, django19, django110)
# defaults to default branch (django111)
cd
cp config/sample/.env config/
mkvirtualenv
# use option --python=$(which python3) to create a python3 virtualenv
setvirtualenvproject
pip install -r requirements/development.txt
python project/manage.py migrate
python project/manage.py runserver
Edit `config/.env` with your setting values.
Project comes with no external DBMS configured (uses default sqlite db).
To install a database:
* add ``psycopg2`` to ``requirements/common.txt``
* uncomment ``DATABASE_URL`` line in ``config/.env`` (setting DB_NAME)
* create db
* launch migrate
.. code-block:: bash
createdb -Upostgres DB_NAME
python project/manage.py migrate
Notes to use geodjango:
* follow instructions to install geolibraries: https://docs.djangoproject.com/en/1.11/ref/contrib/gis/install/geolibs/
Django will produce the following error when trying to execute any commands:
django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.6.2-CAPI-1.10.2 4d2925d6"
To correct this, a single modification is needed in the django distribution, ``django/contrib/gis/geos/libgeos.py``:
.. code-block:: python
version_regex = re.compile(
r'^(?P(?P\d+)\.(?P\d+)\.(?P\d+))'
r'((rc(?P\d+))|dev)?-CAPI-(?P\d+\.\d+\.\d+)( r\d+)?( \w+)?$'
)
Other templates
---------------
- https://github.com/rdegges/django-skel
- https://github.com/jezdez/django-configurations/tree/templates/1.5.x
- https://github.com/jezdez/django-configurations/tree/templates/1.6.x
- https://github.com/twoscoops/django-twoscoops-project
- https://github.com/pydanny/cookiecutter-django
.. _cookiecutter: https://github.com/audreyr/cookiecutter