refactor-builder
Eric Holscher 2013-11-25 22:03:56 -08:00
parent 3de1db0a33
commit efd2d8072e
4 changed files with 6 additions and 11 deletions

View File

@ -23,4 +23,6 @@ urlpatterns = patterns(
url('^%s/(?P<term>[\w\-\.]+)/stats$' % ALL_VERSIONS_RE, url('^%s/(?P<term>[\w\-\.]+)/stats$' % ALL_VERSIONS_RE,
'djangome.views.show_term', 'djangome.views.show_term',
name='show_term'), name='show_term'),
# Hack in a core.views.homepage bit for reverse in base template
url(r'home/', 'core.views.homepage'),
) )

View File

@ -412,8 +412,10 @@ class Project(models.Model):
def cnames_symlink_path(self, domain): def cnames_symlink_path(self, domain):
""" """
Path in the doc_path that we symlink cnames Path in the doc_path that we symlink cnames
This has to be at the top-level because Nginx doesn't know the projects slug.
""" """
return os.path.join(self.doc_path, 'cnames', domain) return os.path.join(settings.CNAME_ROOT, domain)
def translations_symlink_path(self, language=None): def translations_symlink_path(self, language=None):
""" """
@ -489,12 +491,6 @@ class Project(models.Model):
""" """
return os.path.join(self.doc_path, 'rtd-builds', version) return os.path.join(self.doc_path, 'rtd-builds', version)
def rtd_cname_path(self, cname):
"""
The path to the build html docs in the project.
"""
return os.path.join(settings.CNAME_ROOT, cname)
def conf_file(self, version='latest'): def conf_file(self, version='latest'):
if self.conf_py_file: if self.conf_py_file:
log.debug('Inserting conf.py file path from model') log.debug('Inserting conf.py file path from model')

View File

@ -679,10 +679,6 @@ def symlink_cnames(version):
symlink = version.project.rtd_cname_path(cname) symlink = version.project.rtd_cname_path(cname)
run_on_app_servers('mkdir -p %s' % '/'.join(symlink.split('/')[:-1])) run_on_app_servers('mkdir -p %s' % '/'.join(symlink.split('/')[:-1]))
run_on_app_servers('ln -nsf %s %s' % (docs_dir, symlink)) run_on_app_servers('ln -nsf %s %s' % (docs_dir, symlink))
# New symlink location
symlink = version.project.cnames_symlink_path(cname)
run_on_app_servers('mkdir -p %s' % '/'.join(symlink.split('/')[:-1]))
run_on_app_servers('ln -nsf %s %s' % (docs_dir, symlink))
def symlink_subprojects(version): def symlink_subprojects(version):

View File

@ -27,6 +27,7 @@ LOGS_ROOT = os.path.join(SITE_ROOT, 'logs')
MEDIA_ROOT = '%s/media/' % (SITE_ROOT) MEDIA_ROOT = '%s/media/' % (SITE_ROOT)
MEDIA_URL = '/media/' MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/media/admin/' ADMIN_MEDIA_PREFIX = '/media/admin/'
# For 1.4 # For 1.4
STATIC_ROOT = os.path.join(SITE_ROOT, 'media/static/') STATIC_ROOT = os.path.join(SITE_ROOT, 'media/static/')
STATIC_URL = '/static/' STATIC_URL = '/static/'