https://github.com/wooyek/cookiecutter-django-website
Cookiecutter template for a Django project
https://github.com/wooyek/cookiecutter-django-website
Last synced: 3 months ago
JSON representation
Cookiecutter template for a Django project
- Host: GitHub
- URL: https://github.com/wooyek/cookiecutter-django-website
- Owner: wooyek
- License: mit
- Created: 2017-09-08T11:22:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-13T14:18:19.000Z (about 6 years ago)
- Last Synced: 2025-01-07T07:44:28.150Z (5 months ago)
- Language: Python
- Size: 176 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
===================================
Cookiecutter Django Website Package
===================================Cookiecutter_ template for a Python PyPI ready package library with django website project, extends upon `wooyek/cookiecutter-django-app`_
Instead of hacking boilerplate setup you can jump to coding immediately. All the check are already in place and a your package can be nicely released to pypi.
* GitHub repo: https://github.com/wooyek/cookiecutter-django-website/
* Documentation: https://cookiecutter-django-website.readthedocs.io/
* Free software: BSD license.. image:: https://travis-ci.org/wooyek/cookiecutter-django-website.svg
:target: https://travis-ci.org/wooyek/cookiecutter-django-website
:alt: Linux build status on Travis CI.. image:: https://ci.appveyor.com/api/projects/status/github/wooyek/cookiecutter-django-website?svg=true
:target: https://ci.appveyor.com/project/wooyek/cookiecutter-django-website
:alt: Windows build status on Appveyor.. image:: https://readthedocs.org/projects/cookiecutter-django-website/badge/?version=latest
:target: http://cookiecutter-django-website.readthedocs.io/en/latest/
:alt: Documentation build status.. image:: https://api.codeclimate.com/v1/badges/3a10b53e791d1e7a554a/maintainability
:target: https://codeclimate.com/github/wooyek/cookiecutter-django-website/maintainability
:alt: Maintainability.. image:: https://img.shields.io/github/license/wooyek/cookiecutter-django-website.svg
:target: https://github.com/wooyek/cookiecutter-django-website/
:alt: License.. image:: https://img.shields.io/twitter/url/https/github.com/wooyek/cookiecutter-django-website.svg?style=social
:target: https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fwooyek%2Fcookiecutter-django-website
:alt: Tweet about this project.. image:: https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg
:target: https://saythanks.io/to/wooyekFeatures
--------* Testing setup with ``unittest`` and ``python setup.py test`` or ``py.test``
* Travis-CI_: Ready for Travis Continuous Integration testing
* Tox_ testing: Setup to easily test for multiple Python and Django versions
* Sphinx_ docs: Documentation ready for generation with, for example, ReadTheDocs_
* bump2version_: Pre-configured version bumping with a single command
* Auto-release to PyPI_ when you push a new tag to master (optional)
* Split file requirements_ management with inheritance and support for private locally installed packages
* Command line interface using Click (optional)
* `Initialization of Git`_ repo, github origin remote and git-flow
* Python `virtual environment bootstrapping`_
* Git master/develop local/origin sync with a single command
* Release_ (sync, test, bump, publish) with a single command.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _requirements: https://github.com/wooyek/cookiecutter-django-website/tree/master/%7B%7Bcookiecutter.project_slug%7D%7D/requirements
.. _Initialization of Git: https://github.com/wooyek/cookiecutter-django-website/blob/master/hooks/post_gen_project.py
.. _virtual environment bootstrapping: https://github.com/wooyek/cookiecutter-django-website/blob/master/hooks/post_gen_project.py
.. _Release: https://github.com/wooyek/cookiecutter-django-website/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/MakefileQuickstart
----------Before we start we need some tooling::
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python
pipsi install cookiecutter
pipsi install detox
pipsi install pew
pipsi install vex
pipsi install pipenv
pip install "backports.shutil_which ; python_version < '3.4'"Now we can generate and initialize a Django app package project::
cookiecutter https://github.com/wooyek/cookiecutter-django-website.git
You'll be prompted for some infomation, based on your choices cookiecutter create a directory that is your new package.
This directory should contain fully initialized project. Empty but passing tests and ready to be pushed and released.
Post generation provisioning
----------------------------* Activate virtual environemnt and run tests with ``tox``
* Create a repo on Github (or Bitbucket)
* Add the repo to your Travis-CI_ account.
* Add the repo to your ReadTheDocs_ account + turn on the ReadTheDocs service hook.
* Update `requirements/base.txt` file that specifies the packages you will need for
your project and their versions. For more info see the `pip docs for requirements files`_.For more details, see the `cookiecutter-django-website tutorial`_.
Running Tests
~~~~~~~~~~~~~Code has been written, but does it actually work? Let's find out!
::
source .pyvenv/bin/activate
(pyvenv) $ pip install -r requirements/development.txt
(pyvenv) $ pytest
(pyvenv) $ python setup.py test
(pyvenv) $ toxRegister releasing on PyPI
~~~~~~~~~~~~~~~~~~~~~~~~~~First make sure you have newest setuptools installed::
pip install pip setuptools -U
Once you've got at least a prototype working and tests running,
it's time to register the app on PyPI::python setup.py register
Time to release a new version and upload it to PyPi? Bam!
$ make publish
It will sync your local and origin repo, test, increment version number, setup and release package then push to origin master.
.. _Travis-CI: http://travis-ci.org/
.. _Tox: http://testrun.org/tox/
.. _Sphinx: http://sphinx-doc.org/
.. _ReadTheDocs: https://readthedocs.io/
.. _`pyup.io`: https://pyup.io/
.. _bump2version: https://github.com/c4urself/bump2version
.. _PyPi: https://pypi.python.org/pypi.. _`available cookiecutters`: http://cookiecutter.readthedocs.io/en/latest/readme.html#available-cookiecutters
.. _`wooyek/cookiecutter-django-app`: https://github.com/wooyek/cookiecutter-django-app
.. _`network`: https://github.com/wooyek/cookiecutter-django-website/network
.. _`family tree`: https://github.com/wooyek/cookiecutter-django-website/network/members
.. _`pip docs for requirements files`: https://pip.pypa.io/en/stable/user_guide/#requirements-files
.. _`cookiecutter-django-website tutorial`: https://cookiecutter-django-website.readthedocs.io/en/latest/tutorial.html