Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-coates committed Mar 26, 2014
0 parents commit 6a726a1
Show file tree
Hide file tree
Showing 165 changed files with 5,056 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .buildpacks
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/cyberdelia/heroku-geo-buildpack.git
https://github.com/heroku/heroku-buildpack-python.git
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
*.py[cod]

# C extensions
*.so

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

# Installer logs
pip-log.txt

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

# Translations
*.mo

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

default.db
*.db-journal
.idea/workspace.xml
.idea/misc.xml
.scrapy

dev_override.py
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/scopes/scope_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/testrunner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
web: python manage.py collectstatic --noinput; newrelic-admin run-program gunicorn -c gunicorn.py.ini wsgi:application
# scheduler: python manage.py celery worker -B -E --maxtasksperchild=1000 -- This can be used once we have a bigger
# need for more workers and concurrent schedulers. Remove the '-B' from worker when this is ready as we can only ever
# have one scheduler or we'll have concurrency issues.
worker: python /app/.heroku/python/bin/celery -A untitled_api worker -B -E --maxtasksperchild=1000 --loglevel=debug
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
django-skel
===========

A modern Django (1.5) project skeleton.

![A fancy Django project skeleton](https://github.com/rdegges/django-skel/raw/master/docs/source/_static/skel.jpg)


Meta
====

* author: Randall Degges
* email: [email protected]
* status: maintained, in development
* notes: Have feedback? Please send me an email. This project is still in its
infancy, and will be changing rapidly.


Purpose
=======

For background, see: http://rdegges.com/deploying-django

Essentially--deploying Django projects is hard. There are lots of things you
need to take into consideration. Being a Django user for years, I believe I've
found some extremely useful patterns to help manage all sorts of Django sites
(from the very smallest apps, to the largest).

This project is meant to be a boilerplate project for starting development. It
is heavily opinionated in terms of services and tools--but I think the tradeoff
is worthwhile.


Docs
====

The full project documentation is hosted at RTFD: http://django-skel.rtfd.org/.
They are continuously updated to reflect changes and information about the
project, so be sure to read them before using this boilerplate.


Install
=======

django-skel currently supports Django 1.5. To create a new django-skel base
project, run the following command (this assumes you have Django 1.5 installed
already):

$ django-admin.py startproject --template=https://github.com/rdegges/django-skel/zipball/master woot
$ heroku config:add DJANGO_SETTINGS_MODULE=myproject.settings.prod


Where ``woot`` is the name of the project you'd like to create.

This is possible because Django 1.5's ``startproject`` command allows you to
fetch a project template over HTTP (which is what we're doing here).

While not strictly required, it is also recommended to do

$ heroku config:add SECRET_KEY=putsomethingfairlycomplexhere

The production settings pull SECRET_KEY from environment but fallbacks
to a value which is generated mainly for development environment.

This setup allows you to easily keep your site in a public repo if you so
wish without causing opening a route to attack your Django passwords.
28 changes: 28 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os
import pytest

# region DJ Settings
#http://pytest-django.readthedocs.org/en/latest/configuring_django.html#using-django-configurations
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "untitled_api.settings.dev_testing")
# endregion

# region Plugins
#this line is required in order to use the db_with_migrations fixture
#http://pytest.org/latest/plugins.html#requiring-loading-plugins-in-a-test-module-or-conftest-file
pytest_plugins = "untitled_api.libs.django_utils.testing.utils"
# endregion

# region test type command line options
#configure which tests run when: http://pytest.org/latest/example/simple
# .html#control-skipping-of-tests-according-to-command-line-option
def pytest_addoption(parser):
parser.addoption("--test-type", default='unit', help="run specific test type (unit, integration, etc.)")


def pytest_runtest_setup(item):
test_type_specified = item.config.getoption("--test-type")
test_type_found = os.path.basename(item.fspath.dirname).lower()
if test_type_found != test_type_specified:
pytest.skip("Test type: {0} was specified but test type was: {1}".format(test_type_specified, test_type_found))

# endregion
Loading

0 comments on commit 6a726a1

Please sign in to comment.