Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
d0b04c63
Kaydet (Commit)
d0b04c63
authored
Nis 29, 2018
tarafından
Srinivas Reddy Thatiparthy
Kaydeden (comit)
Tim Graham
Nis 30, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #29360 -- Removed Fabric examples in docs.
üst
5d022eae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
46 deletions
+1
-46
deployment.txt
docs/howto/static-files/deployment.txt
+1
-44
spelling_wordlist
docs/spelling_wordlist
+0
-2
No files found.
docs/howto/static-files/deployment.txt
Dosyayı görüntüle @
d0b04c63
...
...
@@ -38,30 +38,7 @@ serving your site, the process may look something like:
:ref:`how to do this with Apache and mod_wsgi <serving-files>`.
You'll probably want to automate this process, especially if you've got
multiple web servers. There's any number of ways to do this automation, but
one option that many Django developers enjoy is `Fabric
<http://fabfile.org/>`_.
Below, and in the following sections, we'll show off a few example fabfiles
(i.e. Fabric scripts) that automate these file deployment options. The syntax
of a fabfile is fairly straightforward but won't be covered here; consult
`Fabric's documentation <http://docs.fabfile.org/>`_, for a complete
explanation of the syntax.
So, a fabfile to deploy static files to a couple of web servers might look
something like::
from fabric.api import *
# Hosts to deploy onto
env.hosts = ['www1.example.com', 'www2.example.com']
# Where your project code lives on the server
env.project_root = '/home/www/myproject'
def deploy_static():
with cd(env.project_root):
run('./manage.py collectstatic -v0 --noinput')
multiple web servers.
Serving static files from a dedicated server
--------------------------------------------
...
...
@@ -89,26 +66,6 @@ the deployment strategy to look something like:
common choice for this step since it only needs to transfer the bits of
static files that have changed.
Here's how this might look in a fabfile::
from fabric.api import *
from fabric.contrib import project
# Where the static files get collected locally. Your STATIC_ROOT setting.
env.local_static_root = '/path/to/static'
# Where the static files should go remotely
env.remote_static_root = '/home/www/static.example.com'
@roles('static')
def deploy_static():
local('./manage.py collectstatic')
project.rsync_project(
remote_dir=env.remote_static_root,
local_dir=env.local_static_root,
delete=True,
)
.. _staticfiles-from-cdn:
Serving static files from a cloud service or CDN
...
...
docs/spelling_wordlist
Dosyayı görüntüle @
d0b04c63
...
...
@@ -212,8 +212,6 @@ ETag
ETags
exe
extensibility
fabfile
fabfiles
Facebook
facto
fallback
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment