Skip to content

Commit

Permalink
🚀 initial project template with cookiecutter-djangopackage
Browse files Browse the repository at this point in the history
  • Loading branch information
dizballanze committed Jun 20, 2017
0 parents commit 44879f3
Show file tree
Hide file tree
Showing 31 changed files with 574 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
branch = true

[report]
omit =
*site-packages*
*tests*
*.tox*
show_missing = True
exclude_lines =
raise NotImplementedError
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{py,rst,ini}]
indent_style = space
indent_size = 4

[*.{html,css,scss,json,yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* django-admin-env-notice version:
* Django version:
* Python version:
* Operating System:

### Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

### What I Did

```
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
```
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
*.py[cod]
__pycache__

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml
htmlcov

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Pycharm/Intellij
.idea

# Complexity
output/*.html
output/*/index.html

# Sphinx
docs/_build
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Config file for automatic testing at travis-ci.org

language: python

python:
- "3.5"

env:
- TOX_ENV=py35-django-18
- TOX_ENV=py34-django-18
- TOX_ENV=py33-django-18
- TOX_ENV=py27-django-18
- TOX_ENV=py35-django-19
- TOX_ENV=py34-django-19
- TOX_ENV=py27-django-19
- TOX_ENV=py35-django-110
- TOX_ENV=py34-django-110
- TOX_ENV=py27-django-110

matrix:
fast_finish: true

# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install: pip install -r requirements_test.txt

# command to run tests using coverage, e.g. python setup.py test
script: tox -e $TOX_ENV

after_success:
- codecov -e TOX_ENV
13 changes: 13 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
=======
Credits
=======

Development Lead
----------------

* Iurii Shikanov <[email protected]>

Contributors
------------

None yet. Why not be the first?
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

MIT License

Copyright (c) 2017, Iurii Shikanov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.




6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include AUTHORS.rst
include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst
recursive-include django_admin_env_notice *.html *.png *.gif *js *.css *jpg *jpeg *svg *py
59 changes: 59 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.PHONY: clean-pyc clean-build docs help
.DEFAULT_GOAL := help
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url

webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
BROWSER := python -c "$$BROWSER_PYSCRIPT"

help:
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'

clean: clean-build clean-pyc

clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr *.egg-info

clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +

lint: ## check style with flake8
flake8 django_admin_env_notice tests

test: ## run tests quickly with the default Python
python runtests.py tests

test-all: ## run tests on every Python version with tox
tox

coverage: ## check code coverage quickly with the default Python
coverage run --source django_admin_env_notice runtests.py tests
coverage report -m
coverage html
open htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/django-admin-env-notice.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ django_admin_env_notice
$(MAKE) -C docs clean
$(MAKE) -C docs html
$(BROWSER) docs/_build/html/index.html

release: clean ## package and upload a release
python setup.py sdist upload
python setup.py bdist_wheel upload

sdist: clean ## package
python setup.py sdist
ls -l dist
76 changes: 76 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
=============================
django-admin-env-notice
=============================

.. image:: https://badge.fury.io/py/django-admin-env-notice.svg
:target: https://badge.fury.io/py/django-admin-env-notice

.. image:: https://travis-ci.org/dizballanze/django-admin-env-notice.svg?branch=master
:target: https://travis-ci.org/dizballanze/django-admin-env-notice

.. image:: https://codecov.io/gh/dizballanze/django-admin-env-notice/branch/master/graph/badge.svg
:target: https://codecov.io/gh/dizballanze/django-admin-env-notice

Visually distinguish environments in Django Admin

Documentation
-------------

The full documentation is at https://django-admin-env-notice.readthedocs.io.

Quickstart
----------

Install django-admin-env-notice::

pip install django-admin-env-notice

Add it to your `INSTALLED_APPS`:

.. code-block:: python
INSTALLED_APPS = (
...
'django_admin_env_notice.apps.DjangoAdminEnvNoticeConfig',
...
)
Add django-admin-env-notice's URL patterns:

.. code-block:: python
from django_admin_env_notice import urls as django_admin_env_notice_urls
urlpatterns = [
...
url(r'^', include(django_admin_env_notice_urls)),
...
]
Features
--------

* TODO

Running Tests
-------------

Does the code actually work?

::

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits
-------

Tools used in rendering this package:

* Cookiecutter_
* `cookiecutter-djangopackage`_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
1 change: 1 addition & 0 deletions django_admin_env_notice/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.1.0'
6 changes: 6 additions & 0 deletions django_admin_env_notice/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8
from django.apps import AppConfig


class DjangoAdminEnvNoticeConfig(AppConfig):
name = 'django_admin_env_notice'
2 changes: 2 additions & 0 deletions django_admin_env_notice/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-

Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

{% comment %}
As the developer of this package, don't place anything here if you can help it
since this allows developers to have interoperability between your template
structure and their own.

Example: Developer melding the 2SoD pattern to fit inside with another pattern::

{% extends "base.html" %}
{% load static %}

<!-- Their site uses old school block layout -->
{% block extra_js %}

<!-- Your package using 2SoD block layout -->
{% block javascript %}
<script src="{% static 'js/ninja.js' %}" type="text/javascript"></script>
{% endblock javascript %}

{% endblock extra_js %}
{% endcomment %}
9 changes: 9 additions & 0 deletions django_admin_env_notice/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.views.generic import TemplateView

from . import views

urlpatterns = [
url(r'', TemplateView.as_view(template_name="base.html")),
]
Empty file.
12 changes: 12 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import

import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

# Additional requirements go here
3 changes: 3 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bumpversion==0.5.3
wheel==0.29.0

8 changes: 8 additions & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage==4.3.4
mock>=1.0.1
flake8>=2.1.0
tox>=1.7.0
codecov>=2.0.0


# Additional test requirements go here
Loading

0 comments on commit 44879f3

Please sign in to comment.