Skip to content

Refresh dev environment #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ help:
@echo " make test - run test suite"
@echo " make coverage - run coverage"
@echo " make resetdb - delete and recreate the sqlite database"
@echo " make quickstart - setup a dev environment the first time"


clean:
Expand All @@ -27,6 +28,13 @@ coverage:
coverage run $(MANAGE) test django_object_actions
coverage report --show-missing

# destroy and then recreate your database
resetdb:
python $(MANAGE) reset_db --router=default --noinput
python $(MANAGE) syncdb --noinput
python $(MANAGE) loaddata sample_data

# just a demo of how to get up and running quickly
quickstart: resetdb
python $(MANAGE) createsuperuser
python $(MANAGE) runserver
15 changes: 6 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Programmatically Enabling Object Admin Actions
``````````````````````````````````````````````

You can programatically enable and disable registered object actions by defining
your own custom ``get_object_actions()`` method. In this example, certain actions
your own custom ``get_object_actions()`` method. In this example, certain actions
only apply to certain object states (i.e. You should not be able to close an company
account if the account is already closed)::

Expand All @@ -142,7 +142,7 @@ account if the account is already closed)::
objectactions.extend(['reactivate_company_account_action', ])

return objectactions



Alternate Installation
Expand Down Expand Up @@ -181,16 +181,13 @@ Getting started *(with virtualenvwrapper)*::
# set up your virtualenv
mkvirtualenv django-object-actions
pip install -r requirements.txt
export DJANGO_SETTINGS_MODULE=example_project.settings
# hack your path so that we can reference packages starting from the root
add2virtualenv .
make test # run test suite
tox # run full test suite, requires more setup
make resetdb # reset the example db
python example_project/manage.py runserver # run debug server

The fixtures will create a user, admin:admin, you can use to log in immediately.
make quickstart # runs 'make resetdb' and some extra steps

Various helpers are available as make commands.
Various helpers are available as make commands. View ``Makefile`` to see what
other utilities you can do.


Similar Packages
Expand Down
2 changes: 1 addition & 1 deletion example_project/polls/fixtures/sample_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"pk": 1,
"model": "polls.poll",
"fields": {
"pub_date": "2012-10-20T18:20:35Z",
"pub_date": "2012-10-20T18:20:35",
"question": "Do you like me?"
}
},
Expand Down
7 changes: 2 additions & 5 deletions example_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ def project_dir(*paths):

SITE_ID = 1

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
USE_L10N = False

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
USE_TZ = False

STATIC_URL = '/static/'

Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Django>=1.4.2

dj-database-url>=0.2.1
psycopg2>=2.4.5
dj-database-url==0.3.0
# for heroku support
psycopg2==2.5.4

Werkzeug>=0.8.3
django-extensions>=0.9
tox==1.7.1
django-extensions==1.3.11
tox==1.7.2
factory-boy==2.4.1
coverage==3.7.1
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ setenv =
PYTHONPATH = {toxinidir}
commands = {envpython} example_project/manage.py test django_object_actions
deps =
dj_database_url
django-extensions>=0.9
dj_database_url==0.3.0
django-extensions==1.3.11
factory-boy==2.4.1

[testenv:py26django14]
Expand Down