You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Linux install them with your normal package manager. On macOS [Homebrew] is an excellent option. For Windows [Chocolatey](https://chocolatey.org/) seems popular but we have no experience with Windows.
15
-
16
-
This project ships with `.python-version` and `.nvmrc` to support **[pyenv]** and **[nvm]**. You can use it to setup the correct versions of Python and Node required for this project.
17
-
18
-
## Basic installation steps
19
-
20
-
<!-- NOTE! Before updating the install steps here, ensure they are reflected in the development install as well -->
21
-
22
-
=== "Debian"
23
-
24
-
This process was tested on **Ubuntu {{ versions.tested_ubuntu.version }}**. It should work on any Debian-based system.
[uv](https://docs.astral.sh/uv/) is an extremely fast Python package and project manager, written in Rust. A single tool to replace pip, pip-tools, pipx, poetry, pyenv, twine, virtualenv, and more.
49
30
50
-
=== "macOS"
31
+
```shell
32
+
curl -LsSf https://astral.sh/uv/install.sh | sh
33
+
```
51
34
52
-
This process was tested on **macOS {{ versions.tested_macos.version }}**.
35
+
### Set up python virtual environment oand install python packages with uv
53
36
54
-
Install Python pip, venv & PostgreSQL:
37
+
The uv sync command will create the virtual environment if it does not exist and install the python packages. For production we add `--frozen` so the `uv.lock` is not updated and `--no-default-frozens` so dev and docs are skipped.
[ -s"$NVM_DIR/nvm.sh" ] &&\."$NVM_DIR/nvm.sh"# This loads nvm
83
61
[ -s"$NVM_DIR/bash_completion" ] &&\."$NVM_DIR/bash_completion"# This loads nvm bash_completion
84
62
nvm install # Install the Node version in .nvmrc
85
63
nvm use # Use the Node version in .nvmrc
86
64
```
87
65
88
-
### Python virtual environment
89
-
90
-
Create the virtual environment, specify the python binary to use and the directory. Then source the activate script to activate the virtual environment. The last line tells Django what settings to use.
Inside your activated virtual environment you will use plain `python` and `pip` commands. Everything inside the virtual environment is python 3 since we specified that when we created it.
All the needed Node packages are listed in `package.json`. Install them with this command.
122
69
123
-
```text
70
+
```shell
124
71
npm install
125
72
```
126
73
127
74
### The Postgres database
128
75
129
-
Postgresql is the database used. The following commands will start the Postgresql service and login to the postgres superuser:
76
+
Postgresql is the database used. See <https://docs.djangoproject.com/en/stable/ref/settings/#databases>
130
77
131
-
```shell
132
-
sudo service postgresql start
133
-
sudo su - postgres
134
-
```
78
+
We use `dj-database-url` so also see <https://github.com/jazzband/dj-database-url>
135
79
136
-
then, enter the postgresql cli with:
80
+
By default Hypha looks for a database with the name "hypha". Set `APP_NAME` to change the database name.
137
81
138
-
```shell
139
-
psql
140
-
```
141
-
142
-
In the CLI use these commands to create the initial hypha database, and add a superuser (replacing `replace_with_username` with the user account that will be running hypha):
143
-
144
-
```sql
145
-
CREATEDATABASEhypha;
146
-
CREATEUSERreplace_with_username WITH SUPERUSER LOGIN;
147
-
```
148
-
149
-
Confirm that this user has trust access in `pg\_hba.conf`. These settings can be restricted later as required.
82
+
APP_NAME = env.str('APP_NAME', 'hypha')
83
+
DATABASES = {
84
+
'default': dj_database_url.config(
85
+
conn_max_age=600,
86
+
default=f'postgres:///{APP_NAME}'
87
+
)
88
+
}
150
89
151
-
To exit out of both the psql interface & the postgres user session, do `Ctrl + D` twice.
152
90
153
91
### Running the app
154
92
@@ -160,14 +98,14 @@ Then use the following commands to test run the server:
\(runs development server at [http://127.0.0.1:8000](http://127.0.0.1:8000)\)
@@ -224,56 +162,44 @@ Follow the instructions, and you're done.
224
162
225
163
### Administration
226
164
227
-
The Django Administration panel can be accessed via [http://apply.server.domain/django-admin/](http://sapply.erver.domain/django-admin/)\(use the email address and password you set in the `python manage.py createsuperuser` step above.\)
165
+
The Django Administration panel can be accessed via `https://apply.server.domain/django-admin/`\(use the email address and password you set in the `python manage.py createsuperuser` step above.\)
228
166
229
-
The Apply dashboard is here: [http://apply.server.domain/dashboard/](http://apply.server.domain/dashboard/). The Wagtail admin: [http://apply.server.domain/admin](http://apply.server.domain/admin)
167
+
The Apply dashboard is here: `http://apply.server.domain/dashboard/`. The Wagtail admin: `http://apply.server.domain/admin`
230
168
231
-
### settings
169
+
### Settings
232
170
233
171
Here is a list of settings that can be set as environment variables or in a `hypha/settings/local.py` file.
234
172
235
173
**None optional:**
236
174
237
175
```text
238
-
CACHE_CONTROL_MAX_AGE: 14400
176
+
SECRET_KEY: [KEY]
239
177
DJANGO_SETTINGS_MODULE: hypha.settings.production
178
+
PRIMARY_HOST: www.example.org
240
179
EMAIL_HOST: example.org
241
180
ORG_EMAIL: hello@example.org
242
181
ORG_GUIDE_URL: https://guide.example.org/
243
182
ORG_LONG_NAME: Long name of your organisation
244
183
ORG_SHORT_NAME: Short org name
245
-
PRIMARY_HOST: www.example.org
246
-
PROJECTS_AUTO_CREATE: false
247
-
PROJECTS_ENABLED: true
248
-
SECRET_KEY: [KEY]
249
-
SEND_MESSAGES: true
250
184
SERVER_EMAIL: app@example.org
185
+
SEND_MESSAGES: true
251
186
```
252
187
253
-
**Optional:**
188
+
**Turn on Hypha features that are off by default:**
0 commit comments