<commit_before># Django deployment

set :python, "python"

set :django_project_subdirectory, "project"

depend :remote, :command, "#{python}"

def django_manage(cmd, path="#{latest_release}")
  run "cd #{path}/#{django_project_subdirectory}; #{python} manage.py #{cmd}"
end

namespace :django do
  desc "Run manage.py syncdb in latest release."
  task :syncdb do
    django_manage "syncdb"
  end

  desc "Run custom Django management command in latest release."
  task :manage do
    set_from_env_or_ask :command, "Enter management command"
    django_manage "#{command}"
  end
end

after "deploy:update", "django:syncdb"

# depend :remote, :python_module, "module_name"
# runs #{python} and tries to import module_name.
class Capistrano::Deploy::RemoteDependency
  def python_module(module_name, options={})
    @message ||= "Cannot import `#{module_name}'"
    python = configuration.fetch(:python, "python")
    try("#{python} -c 'import #{module_name}'", options)
    self
  end
end<commit_msg>Use --noinput in django:syncdb<commit_after># Django deployment

set :python, "python"

set :django_project_subdirectory, "project"

depend :remote, :command, "#{python}"

def django_manage(cmd, path="#{latest_release}")
  run "cd #{path}/#{django_project_subdirectory}; #{python} manage.py #{cmd}"
end

namespace :django do
  desc "Run manage.py syncdb in latest release."
  task :syncdb do
    django_manage "syncdb --noinput"
  end

  desc "Run custom Django management command in latest release."
  task :manage do
    set_from_env_or_ask :command, "Enter management command"
    django_manage "#{command}"
  end
end

after "deploy:update", "django:syncdb"

# depend :remote, :python_module, "module_name"
# runs #{python} and tries to import module_name.
class Capistrano::Deploy::RemoteDependency
  def python_module(module_name, options={})
    @message ||= "Cannot import `#{module_name}'"
    python = configuration.fetch(:python, "python")
    try("#{python} -c 'import #{module_name}'", options)
    self
  end
end
{'fraction_non_alphanumeric': 0.1309935739001483, 'fraction_numerical': 0.0, 'mean_word_length': 5.18960244648318, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4073001', 'n_tokens_mistral': 642, 'n_tokens_neox': 640, 'n_words': 193}