[PATCH] Move django-registration to apps/..

martin f. krafft madduck at madduck.net
Sun Jan 31 12:39:59 EST 2010


django-registration was written to live directly in the Python path, not
in the app's module directory. Thus, move it to .. and update the
documentation.

Signed-off-by: martin f. krafft <madduck at madduck.net>
---
 apps/manage.py    |   12 ++++++++++--
 apps/registration |    1 -
 docs/INSTALL      |    6 +++---
 registration      |    1 +
 4 files changed, 14 insertions(+), 6 deletions(-)
 delete mode 120000 apps/registration
 create mode 120000 registration

diff --git a/apps/manage.py b/apps/manage.py
index 1f6f0ed..b6cc7e8 100755
--- a/apps/manage.py
+++ b/apps/manage.py
@@ -1,14 +1,22 @@
 #!/usr/bin/python
 
-import sys
+import os, sys
 
 from django.core.management import execute_manager
 try:
     import settings # Assumed to be in the same directory.
 except ImportError:
-    import sys
     sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
     sys.exit(1)
 
+try:
+    import registration
+except ImportError:
+    # let Django try to import from .. too
+    basedir = os.path.dirname(__file__)
+    if basedir == '.': basedir = os.getcwd()
+    basedir = os.path.dirname(basedir)
+    sys.path.append(basedir)
+
 if __name__ == "__main__":
     execute_manager(settings)
diff --git a/apps/registration b/apps/registration
deleted file mode 120000
index 2d4e4c9..0000000
--- a/apps/registration
+++ /dev/null
@@ -1 +0,0 @@
-../lib/packages/django-registration/registration
\ No newline at end of file
diff --git a/docs/INSTALL b/docs/INSTALL
index c5df9f3..3cd001e 100644
--- a/docs/INSTALL
+++ b/docs/INSTALL
@@ -65,13 +65,13 @@ in brackets):
 
          cd lib/packages/
          hg clone http://bitbucket.org/ubernostrum/django-registration/
-         cd ../../apps
-         ln -s ../lib/packages/django-registration/registration ./registration
+         cd ../..
+         ln -s lib/packages/django-registration/registration ./registration
 
         Please note that versions beyond 0.7 require Django 1.1, so unless you
         have Django 1.1, please check out version 0.7:
 
-         cd ../lib/packages/
+         cd lib/packages/
          hg co v0.7
 
 		We also use some Javascript libraries:
diff --git a/registration b/registration
new file mode 120000
index 0000000..694b4cc
--- /dev/null
+++ b/registration
@@ -0,0 +1 @@
+lib/packages/django-registration/registration
\ No newline at end of file
-- 
1.5.6.5



More information about the Patchwork mailing list