Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed use of Seamless Django and VirtualEnv integration snippet

  • Loading branch information...
commit 790c5287e9e43cc71abe8c7ac40f6d9d7bae644c 1 parent cbbcd74
@funkotron funkotron authored
Showing with 1 addition and 59 deletions.
  1. +1 −59 manage.py
View
60 manage.py
@@ -4,64 +4,6 @@
# License www.tree.io/license
#!/usr/bin/env python
-import sys
-import shutil
-try:
- import virtualenv
-except ImportError:
- print 'Error: virtualenv module not found. Please install virtualenv (e.g. pip install virtualenv)'
-import subprocess
-from os import path
-
-PROJECT_ROOT = path.abspath(path.dirname(__file__))
-REQUIREMENTS = path.join(PROJECT_ROOT, 'requirements.pip')
-
-VE_ROOT = path.join(PROJECT_ROOT, '.ve')
-VE_TIMESTAMP = path.join(VE_ROOT, 'timestamp')
-VE_ACTIVATE = path.join(VE_ROOT, 'bin', 'activate_this.py')
-
-envtime = path.exists(VE_ROOT) and path.getmtime(VE_ROOT) or 0
-envreqs = path.exists(VE_TIMESTAMP) and path.getmtime(VE_TIMESTAMP) or 0
-envspec = path.getmtime(REQUIREMENTS)
-
-def go_to_ve():
- # going into ve
- if not VE_ROOT in sys.prefix:
- if sys.platform == 'win32':
- python = path.join(VE_ROOT, 'Scripts', 'python.exe')
- else:
- python = path.join(VE_ROOT, 'bin', 'python')
- try:
- retcode = subprocess.call([python, __file__] + sys.argv[1:])
- except KeyboardInterrupt:
- retcode = 1
- sys.exit(retcode)
-
-update_ve = 'update_ve' in sys.argv
-if update_ve or envtime < envspec or envreqs < envspec:
- if update_ve:
- # install ve
- if envtime < envspec:
- if path.exists(VE_ROOT):
- shutil.rmtree(VE_ROOT)
- virtualenv.logger = virtualenv.Logger(consumers=[])
- virtualenv.create_environment(VE_ROOT, site_packages=True)
-
- go_to_ve()
-
- # check requirements
- if update_ve or envreqs < envspec:
- import pip
- pip.main(initial_args=['install', '-r', REQUIREMENTS, '--upgrade'])
- file(VE_TIMESTAMP, 'w').close()
- sys.exit(0)
- else:
- print "VirtualEnv need to be updated"
- print "Run ./manage.py update_ve"
- sys.exit(1)
-
-go_to_ve()
-
from django.core.management import execute_manager
import imp
try:
@@ -74,4 +16,4 @@ def go_to_ve():
import settings
if __name__ == "__main__":
- execute_manager(settings)
+ execute_manager(settings)

1 comment on commit 790c528

@letoosh

Now we have no way to install dependencies (update_ve is gone), and they are not described anywhere. In practice, this means a lot of guesswork for users.

Please sign in to comment.
Something went wrong with that request. Please try again.