1
1
Installation
2
2
============
3
3
4
- Here is a step by step plan on how to install Read the Docs.
4
+ Here is a step by step guide on how to install Read the Docs.
5
5
It will get you to a point of having a local running instance.
6
6
7
+ Requirements
8
+ ------------
7
9
8
- First, obtain `Python 3.6 `_ and virtualenv _ if you do not already have them. Using a
9
- virtual environment will make the installation easier, and will help to avoid
10
- clutter in your system-wide libraries. You will also need Git _ in order to
11
- clone the repository. If you plan to import Python 2.7 project to your RTD then you'll
12
- need to install Python 2.7 with virtualenv in your system as well.
10
+ First, obtain `Python 3.6 `_ and virtualenv _ if you do not already have them.
11
+ Using a virtual environment is strongly recommended,
12
+ since it will help you to avoid clutter in your system-wide libraries.
13
13
14
+ Additionally Read the Docs depends on:
14
15
15
- .. _Python 3.6 : http://www.python.org/
16
- .. _virtualenv : http://pypi.python.org/pypi/virtualenv
17
- .. _Git : http://git-scm.com/
18
- .. _Homebrew : http://brew.sh/
19
- .. _Elasticsearch : https://www.elastic.co/products/elasticsearch
20
- .. _PostgreSQL : https://www.postgresql.org/
21
- .. _Redis : https://redis.io/
22
-
23
- .. note ::
16
+ * `Git `_ (version >=2)
17
+ * `Mercurial `_ (only if you need to work with mercurial repositories)
18
+ * `Pip `_ (version >1.5)
19
+ * `Redis `_
20
+ * `Elasticsearch `_ (only if you want full support for searching inside the site)
24
21
25
- Requires Git version >=2
22
+ * Ubuntu users could install this package by following :doc: ` /custom_installs/elasticsearch `.
26
23
27
24
.. note ::
28
25
29
- If you are having trouble on OS X Mavericks (or possibly other versions of
30
- OS X) with building ``lxml ``, you probably might need to use Homebrew _
31
- to ``brew install libxml2 ``, and invoke the install with::
26
+ If you plan to import Python 2 projects to your RTD,
27
+ then you'll need to install Python 2 with virtualenv in your system as well.
32
28
33
- CFLAGS=-I/usr/local/opt/libxml2/include/libxml2 \
34
- LDFLAGS=-L/usr/local/opt/libxml2/lib \
35
- pip install -r requirements.txt
29
+ In order to get all the dependencies successfully installed,
30
+ you need these libraries.
36
31
37
- .. note ::
32
+ .. tabs ::
33
+
34
+ .. tab :: Mac OS
38
35
39
- Linux users may find they need to install a few additional packages
40
- in order to successfully execute ``pip install -r requirements.txt ``.
41
- For example, a clean install of Ubuntu 14.04 LTS will require the
42
- following packages::
36
+ If you are having trouble on OS X Mavericks
37
+ (or possibly other versions of OS X) with building ``lxml ``,
38
+ you probably might need to use Homebrew _ to ``brew install libxml2 ``,
39
+ and invoke the install with::
40
+
41
+ CFLAGS=-I/usr/local/opt/libxml2/include/libxml2 \
42
+ LDFLAGS=-L/usr/local/opt/libxml2/lib \
43
+ pip install -r requirements.txt
43
44
44
- sudo apt-get install build-essential
45
- sudo apt-get install python-dev python-pip python-setuptools
46
- sudo apt-get install libxml2-dev libxslt1-dev zlib1g-dev
45
+ .. tab :: Ubuntu
47
46
48
- CentOS/RHEL 7 will require ::
47
+ Install ::
49
48
50
- sudo yum install python-devel python-pip libxml2-devel libxslt-devel
49
+ sudo apt-get install build-essential
50
+ sudo apt-get install python-dev python-pip python-setuptools
51
+ sudo apt-get install libxml2-dev libxslt1-dev zlib1g-dev
51
52
52
- Users of other Linux distributions may need to install the equivalent
53
- packages, depending on their system configuration.
53
+ If you don't have redis installed yet, you can do it with::
54
+
55
+ sudo apt-get install redis-server
54
56
55
- .. note ::
56
-
57
- If you want full support for searching inside your Read the Docs
58
- site you will need to install Elasticsearch _.
57
+ .. tab :: CentOS/RHEL 7
59
58
60
- Ubuntu users could install this package by following :doc: `/custom_installs/elasticsearch `.
61
-
62
- .. note ::
59
+ Install::
63
60
64
- Besides the Python specific dependencies, you will also need Redis _.
61
+ sudo yum install python-devel python-pip libxml2-devel libxslt-devel
65
62
66
- Ubuntu users could install this package as following::
63
+ .. tab :: Other OS
67
64
68
- sudo apt-get install redis-server
65
+ On other operating systems no further dependencies are required,
66
+ or you need to find the proper equivalent libraries.
69
67
70
68
71
- You will need to verify that your pip version is higher than 1.5 you can do this as such::
72
-
73
- pip --version
69
+ .. _Python 3.6 : http://www.python.org/
70
+ .. _virtualenv : https://virtualenv.pypa.io/en/stable/
71
+ .. _Git : http://git-scm.com/
72
+ .. _Mercurial : https://www.mercurial-scm.org/
73
+ .. _Pip : https://pip.pypa.io/en/stable/
74
+ .. _Homebrew : http://brew.sh/
75
+ .. _Elasticsearch : https://www.elastic.co/products/elasticsearch
76
+ .. _Redis : https://redis.io/
74
77
75
- If this is not the case please update your pip version before continuing::
76
78
77
- pip install --upgrade pip
79
+ Get and run Read the Docs
80
+ -------------------------
78
81
79
- Once you have these, create a virtual environment somewhere on your disk, then
80
- activate it::
82
+ Clone the repository somewhere on your disk and enter to the repository::
81
83
82
- virtualenv rtd
83
- cd rtd
84
- source bin/activate
84
+ git clone https://github.com/rtfd/readthedocs.org.git
85
+ cd readthedocs.org
85
86
86
- Create a folder in here, and clone the repository ::
87
+ Create a virtual environment and activate it ::
87
88
88
- mkdir checkouts
89
- cd checkouts
90
- git clone https://github.com/rtfd/readthedocs.org.git
89
+ virtualenv venv
90
+ source venv/bin/activate
91
91
92
- Next, install the dependencies using ``pip `` (included inside of virtualenv _)::
92
+ Next, install the dependencies using ``pip ``
93
+ (make sure you are inside of the virtual environment)::
93
94
94
- cd readthedocs.org
95
95
pip install -r requirements.txt
96
96
97
- This may take a while, so go grab a beverage. When it's done, build your
98
- database::
97
+ This may take a while, so go grab a beverage.
98
+ When it's done, build the database::
99
99
100
100
python manage.py migrate
101
101
102
- Then please create a superuser account for Django::
102
+ Then create a superuser account for Django::
103
103
104
104
python manage.py createsuperuser
105
105
106
106
Now let's properly generate the static assets::
107
107
108
108
python manage.py collectstatic
109
109
110
- By now, it is the right time to load in a couple users and a test project ::
110
+ Now you can optionally load a couple users and test projects ::
111
111
112
112
python manage.py loaddata test_data
113
113
@@ -120,35 +120,56 @@ By now, it is the right time to load in a couple users and a test project::
120
120
create an ``EmailAddress `` entry for the user, then you can use ``shell_plus `` to
121
121
update the object with ``primary=True ``, ``verified=True ``.
122
122
123
- Finally, you're ready to start the webserver ::
123
+ Finally, you're ready to start the web server ::
124
124
125
125
python manage.py runserver
126
126
127
- Visit http://127.0.0.1:8000/ in your browser to see how it looks; you can use
128
- the admin interface via http://127.0.0.1:8000/admin (logging in with the
129
- superuser account you just created).
127
+ Visit http://127.0.0.1:8000/ in your browser to see how it looks;
128
+ you can use the admin interface via http://127.0.0.1:8000/admin
129
+ (logging in with the superuser account you just created).
130
130
131
- For builds to properly kick off as expected, it is necessary the port
132
- you're serving on (i.e. ``runserver 0.0.0.0:8080 ``) match the port defined
133
- in ``PRODUCTION_DOMAIN ``. You can utilize ``local_settings.py `` to modify this.
134
- (By default, it's ``localhost:8000 ``)
131
+ For builds to properly work as expected,
132
+ it is necessary the port you're serving on
133
+ (i.e. ``python manage.py runserver 0.0.0.0:8080 ``)
134
+ match the port defined in ``PRODUCTION_DOMAIN ``.
135
+ You can use ``readthedocs/settings/local_settings.py `` to modify this
136
+ (by default, it's ``localhost:8000 ``).
135
137
136
- While the webserver is running, you can build documentation for the latest version of
137
- a project called 'pip' with the ``update_repos `` command. You can replace 'pip'
138
- with the name of any added project ::
138
+ While the web server is running,
139
+ you can build the documentation for the latest version of any project using the ``update_repos `` command.
140
+ For example to update the `` pip `` repo ::
139
141
140
142
python manage.py update_repos pip
141
143
144
+ .. note ::
145
+
146
+ If you have problems building successfully a project,
147
+ probably is because some missing libraries for ``pdf `` and ``epub `` generation.
148
+ You can uncheck this on the advanced settings of your project.
149
+
142
150
What's available
143
151
----------------
144
152
145
153
After registering with the site (or creating yourself a superuser account),
146
154
you will be able to log in and view the `dashboard <http://localhost:8000/dashboard/ >`_.
147
155
148
156
Importing your docs
149
- ^^^^^^^^^^^^^^^^^^^
157
+ ~~~~~~~~~~~~~~~~~~~
150
158
151
159
One of the goals of readthedocs.org is to make it easy for any open source developer to get high quality hosted docs with great visibility!
152
160
Simply provide us with the clone URL to your repo, we'll pull your code, extract your docs, and build them!
161
+
153
162
We make available a post-commit webhook that can be configured to update the docs whenever you commit to your repo.
154
- See :doc: `/intro/import-guide ` to learn more.
163
+ See our :doc: `/intro/import-guide ` page to learn more.
164
+
165
+ Further steps
166
+ -------------
167
+
168
+ By now you can trigger builds on your local environment,
169
+ to encapsulate the build process inside a Docker container,
170
+ see :doc: `development/buildenvironments `.
171
+
172
+ For building this documentation,
173
+ see :doc: `docs `.
174
+
175
+ And for setting up for the front end development, see :doc: `development/standards `.
0 commit comments