def restart(request): """ Ajax view. Restarts runserver """ task = ProcessTask.objects.create(task=process_cmd_string('"%(django)s" kill_runserver'), lock=True, wait=True) ProcessTask.objects.create(task=process_cmd_string('"%(django)s" runserver --noreload')) task.lock = False task.save() return HttpResponse()
def load(request): """ Show wait circle loader, fetch packages from index site. Template has AJAX checker, so user will be redirected to next step automatically. Saves installation information for packages. Makes settings.py, urls.py, manage.py with installed setup-packages. Syncdb for setup-packages. """ task = ProcessTask.objects.create( task=process_cmd_string('"%(django)s" kill_runserver'), lock=True, wait=True) ProcessTask.objects.create(task=process_cmd_string('"%(django)s" install_packages'), wait=True) ProcessTask.objects.create(task=process_cmd_string('"%(django)s" change_settings'), wait=True) ProcessTask.objects.create(task=process_cmd_string('"%(django)s" syncdb --noinput'), wait=True) ProcessTask.objects.create(task=process_cmd_string('"%(django)s" runserver --noreload')) return render_to_response('redsolutioncms/wait.html', { 'task_id':task.id, 'redirect_to': reverse('custom'), 'start_task_id':task.id, 'title': _('Downloading packages'), }, context_instance=RequestContext(request))
def build(request): cms_settings = CMSSettings.objects.get_settings() task = ProcessTask.objects.create( task=process_cmd_string('"%(django)s" kill_runserver'), lock=True, wait=True) project_params = { 'project_bootstrap': os.path.join(project_dir, 'bootstrap.py'), 'project_buildout_cfg': os.path.join(project_dir, 'develop.cfg'), 'project_buildout': os.path.join(project_dir, 'bin', 'buildout'), 'project_django': os.path.join(project_dir, 'bin', 'django'), } ProcessTask.objects.create( task=process_cmd_string('"%(python)s" "%(project_bootstrap)s" -c "%(project_buildout_cfg)s"', project_params), wait=True) ProcessTask.objects.create( task=process_cmd_string('"%(project_buildout)s" -c "%(project_buildout_cfg)s"', project_params), wait=True) ProcessTask.objects.create( task=process_cmd_string('"%(project_django)s" syncdb --noinput', project_params), wait=True) ProcessTask.objects.create( task=process_cmd_string('"%(project_django)s" runserver 8001 --noreload', project_params)) ProcessTask.objects.create( task=process_cmd_string('"%(django)s" runserver --noreload')) return render_to_response('redsolutioncms/wait.html', { 'task_id': task.id, 'redirect_to': reverse('create_superuser'), 'start_task_id':task.id, 'title': _('Building your site'), }, context_instance=RequestContext(request))
def handle(self, *args, **options): ProcessTask.objects.create(task=process_cmd_string('"%(django)s" runserver --noreload')) ProcessTask.objects.create(task=process_cmd_string('"%(django)s" open_browser')) self.wrapper()