mirror of
https://github.com/Django-LiveView/docs.git
synced 2024-12-22 19:05:35 +01:00
Add deploy
This commit is contained in:
parent
aa6807f26b
commit
0b2dc4fb0c
@ -136,6 +136,7 @@ a:hover,
|
||||
border-bottom: 2px solid var(--color-brown);
|
||||
background-color: var(--color-black);
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
@media (width < 600px) {
|
||||
|
46
one.org
46
one.org
@ -321,6 +321,52 @@ And open the browser at ~http://localhost:8000/~. You should see the home page w
|
||||
#+ATTR_HTML: :class block-center
|
||||
[[#/img/quickstart/minimal-template.webp][Random number]]
|
||||
|
||||
* Deploy
|
||||
:PROPERTIES:
|
||||
:ONE: one-custom-default-doc
|
||||
:CUSTOM_ID: /docs/deploy/
|
||||
:TITLE: Deploy
|
||||
:DESCRIPTION: Deploy Django LiveView to production.
|
||||
:END:
|
||||
|
||||
You can deploy Django LiveView using any web server like reverse proxy.
|
||||
|
||||
** Nginx
|
||||
|
||||
I recommend using Nginx. Here is an example of how to configure. Replace ~example.com~ with your domain and ~my-project~ with your folder name.
|
||||
|
||||
#+BEGIN_SRC nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name example.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Host $server_name;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
location /static {
|
||||
root /var/www/my-project;
|
||||
}
|
||||
|
||||
location /media {
|
||||
root /var/www/my-project;
|
||||
}
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
}
|
||||
#+END_SRC
|
||||
|
||||
It is important to note that the ~proxy_set_header~ lines are necessary for the WebSocket to work. You can see more about it in [[https://channels.readthedocs.io/en/latest/deploying.html][Channels]].
|
||||
|
||||
* FAQ
|
||||
:PROPERTIES:
|
||||
:ONE: one-custom-default-doc
|
||||
|
2
onerc.el
2
onerc.el
@ -105,6 +105,8 @@
|
||||
(:ul.nav__list.nav__list--docs.nav-docs__list
|
||||
(:li.nav-docs__item
|
||||
(:a.nav-docs__link (@ :href "/docs/quickstart/") "Quickstart"))
|
||||
(:li.nav-docs__item
|
||||
(:a.nav-docs__link (@ :href "/docs/deploy/") "Deploy"))
|
||||
(:li.nav-docs__item
|
||||
(:a.nav-docs__link (@ :href "/docs/faq/") "FAQ"))
|
||||
)))
|
||||
|
Loading…
Reference in New Issue
Block a user