Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Commit

Permalink
Simplified development by re-adding a custom manage.py
Browse files Browse the repository at this point in the history
  • Loading branch information
brutasse committed May 19, 2013
1 parent 746f0f9 commit 82886bd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Procfile.dev
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: envdir env django-admin.py runserver 0.0.0.0:8000
web: python manage.py runserver 0.0.0.0:8000
9 changes: 2 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ first!
Hacking
-------

You need `Daemontools`_ and `Foreman`_ installed.

.. _Daemontools: http://cr.yp.to/daemontools.html
.. _Foreman: https://github.com/ddollar/foreman

::

git clone git@github.com:brutasse/djangopeople.git
Expand All @@ -31,7 +26,7 @@ Check ``env/DATABASE_URL`` to configure a local DB.
Then::

make db
make run
python manage.py runserver

The development server is now running on http://localhost:8000.

Expand Down Expand Up @@ -69,7 +64,7 @@ First deploy::
Subsequent deploys::

git push heroku master
heroku run django-admin.py collectstatic
heroku run django-admin.py collectstatic --noinput

-------

Expand Down
19 changes: 19 additions & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python
import os
import sys
import glob

if __name__ == "__main__":
if 'test' in sys.argv:
env_dir = os.path.join('tests', 'env')
else:
env_dir = 'env'
env_vars = glob.glob(os.path.join(env_dir, '*'))
for env_var in env_vars:
with open(env_var, 'r') as env_var_file:
os.environ.setdefault(env_var.split(os.sep)[-1],
env_var_file.read().strip())

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)

0 comments on commit 82886bd

Please sign in to comment.