Skip to content

Commit 220506a

Browse files
committed
Merge pull request #22 from texastribune/refresh-dev
Refresh dev environment
2 parents c446423 + 535aeaf commit 220506a

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ help:
88
@echo " make test - run test suite"
99
@echo " make coverage - run coverage"
1010
@echo " make resetdb - delete and recreate the sqlite database"
11+
@echo " make quickstart - setup a dev environment the first time"
1112

1213

1314
clean:
@@ -27,6 +28,13 @@ coverage:
2728
coverage run $(MANAGE) test django_object_actions
2829
coverage report --show-missing
2930

31+
# destroy and then recreate your database
3032
resetdb:
3133
python $(MANAGE) reset_db --router=default --noinput
3234
python $(MANAGE) syncdb --noinput
35+
python $(MANAGE) loaddata sample_data
36+
37+
# just a demo of how to get up and running quickly
38+
quickstart: resetdb
39+
python $(MANAGE) createsuperuser
40+
python $(MANAGE) runserver

README.rst

+6-9
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Programmatically Enabling Object Admin Actions
117117
``````````````````````````````````````````````
118118

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

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

144144
return objectactions
145-
145+
146146

147147

148148
Alternate Installation
@@ -181,16 +181,13 @@ Getting started *(with virtualenvwrapper)*::
181181
# set up your virtualenv
182182
mkvirtualenv django-object-actions
183183
pip install -r requirements.txt
184-
export DJANGO_SETTINGS_MODULE=example_project.settings
184+
# hack your path so that we can reference packages starting from the root
185185
add2virtualenv .
186186
make test # run test suite
187-
tox # run full test suite, requires more setup
188-
make resetdb # reset the example db
189-
python example_project/manage.py runserver # run debug server
190-
191-
The fixtures will create a user, admin:admin, you can use to log in immediately.
187+
make quickstart # runs 'make resetdb' and some extra steps
192188

193-
Various helpers are available as make commands.
189+
Various helpers are available as make commands. View ``Makefile`` to see what
190+
other utilities you can do.
194191

195192

196193
Similar Packages

example_project/polls/fixtures/sample_data.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"pk": 1,
44
"model": "polls.poll",
55
"fields": {
6-
"pub_date": "2012-10-20T18:20:35Z",
6+
"pub_date": "2012-10-20T18:20:35",
77
"question": "Do you like me?"
88
}
99
},

example_project/settings.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@ def project_dir(*paths):
2727

2828
SITE_ID = 1
2929

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

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

3734
STATIC_URL = '/static/'
3835

requirements.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Django>=1.4.2
22

3-
dj-database-url>=0.2.1
4-
psycopg2>=2.4.5
3+
dj-database-url==0.3.0
4+
# for heroku support
5+
psycopg2==2.5.4
56

6-
Werkzeug>=0.8.3
7-
django-extensions>=0.9
8-
tox==1.7.1
7+
django-extensions==1.3.11
8+
tox==1.7.2
99
factory-boy==2.4.1
1010
coverage==3.7.1

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ setenv =
2323
PYTHONPATH = {toxinidir}
2424
commands = {envpython} example_project/manage.py test django_object_actions
2525
deps =
26-
dj_database_url
27-
django-extensions>=0.9
26+
dj_database_url==0.3.0
27+
django-extensions==1.3.11
2828
factory-boy==2.4.1
2929

3030
[testenv:py26django14]

0 commit comments

Comments
 (0)