33[ ![ codecov] ( https://codecov.io/gh/MAKENTNU/web/graph/badge.svg?token=EL6fslS1y2 )] ( https://codecov.io/gh/MAKENTNU/web )
44
55
6- ## Setup
6+ ## 🛠️ Setup
77
88<details >
99<summary >Click to expand</summary >
1010
11- ### Prerequisites
12-
13- * [ Git] ( https://git-scm.com/downloads )
14- * Using a [ Git GUI] ( https://git-scm.com/downloads/guis ) is highly recommended, as they allow for much easier and faster visualization of the commit
15- structure, and interaction with it, which will help you avoid many common mistakes
16- * [ Git Extensions] ( https://gitextensions.github.io/ ) is a good choice - though it only runs on Windows, as of time of writing
17- * Python ** 3.10** + (latest, stable version preferred)
18- * Having cloned this repository to your machine
19- * Either press a "Clone repository" button in your Git GUI, or run:
20- ``` shell
21- git clone https://github.com/MAKENTNU/web.git
22- ```
11+ 1 . [ Install uv] ( https://docs.astral.sh/uv/getting-started/installation/ ) (a Python package manager)
12+ 1 . [ Install Git] ( https://git-scm.com/downloads )
13+ 1 . Installing a [ Git GUI] ( https://git-scm.com/downloads/guis ) is highly recommended, as they allow for much easier and faster visualization of
14+ the commit structure, and interaction with it, which will help you avoid many common mistakes
15+ * [ Git Extensions] ( https://gitextensions.github.io/ ) is an excellent choice, with support for pretty much all Git features you'll ever use - though
16+ it only runs on Windows, as of time of writing
17+ * [ GitHub Desktop] ( https://github.com/apps/desktop ) works well, but has very limited functionality
18+ 1 . Clone this repository to your machine
19+ * Either press a "Clone repository" button in your Git GUI, or run:
20+ ``` shell
21+ git clone https://github.com/MAKENTNU/web.git
22+ ```
23+ 1. Install dev dependencies:
24+ (this will create a ` .venv` folder inside your repository folder, by default)
25+ ` ` ` shell
26+ uv sync --group dev
27+ ` ` `
2328
2429# ### PyCharm
2530
@@ -28,66 +33,25 @@ and because it's able to integrate all the IntelliJ-specific settings in [the pr
2833
2934If you decide to use this IDE, open the repo folder cloned as part of the prerequisites, through PyCharm (File → Open...),
3035and set the following settings (File → Settings...):
31- * Under " **Languages & Frameworks **" → " Django" :
36+ * Under " **Python **" → " Django" :
3237 * Make sure the " Enable Django Support" checkbox is checked
3338 * " Django project root:" ` < repo folder location> /src`
3439 * " Settings:" ` web/settings.py`
3540 * " Manage script:" ` < repo folder location> /manage.py`
36- * Under " **Project: \<repo folder name\>** " → " Project Structure " :
41+ * Under " **Project Structure** " :
3742 * Mark the ` src` folder as " Sources"
43+ * Follow [these instructions](https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html#-r16mz0_87)
44+ to add the _existing_ uv environment that you created inside the ` .venv` folder
3845
39- # ## Installation
40-
41- 1. Create a virtual environment, presumably named ` venv` :
42- * This should be placed in the folder * containing* the project folder, and not inside the project folder itself
43- * Example folder structure (where ` web` is the name of the project folder):
44- ```
45- MAKE
46- ├─ venv
47- └─ web
48- └─ README.md (this file)
49- ```
50- * Among other things, this prevents translations from being made inside the virtual environment folder
51- when running the ` makemessages` management command
52- * If using PyCharm, and a virtual environment was not created as part of the project creation process, refer to
53- [the " Configure a virtual environment" guide](https://www.jetbrains.com/help/pycharm/creating-virtual-environment.html#python_create_virtual_env)
54- * Otherwise, ` cd` to the project folder, and run:
55- ` ` ` shell
56- [newest installed Python command, like python3.11] -m venv ../venv
57- ` ` `
58- 1. Activate the virtual environment:
59- * If using PyCharm, this should be done automatically when opening a terminal tab inside the IDE
60- * Otherwise, ` cd` to the project folder, and run:
61- * On Windows:
62- ` ` ` shell
63- ..\v env\S cripts\a ctivate
64- ` ` `
65- * On Linux/macOS:
66- ` ` ` shell
67- source ../venv/bin/activate
68- ` ` `
69- 1. Install requirements:
70- * If using Windows, first download the correct wheel for the [` python-ldap` ](https://pypi.org/project/python-ldap/) package
71- from [Christoph Gohlke](https://github.com/cgohlke)' s [python-ldap-build repository](https://github.com/cgohlke/python-ldap-build).
72- and install it:
73- ```shell
74- pip install [path to .whl file]
75- ```
76- (It is possible to instead build `python-ldap` from source, but it' s a bit cumbersome setting up the right build tools.)
77- * Regardless of operating system, run:
78- ` ` ` shell
79- pip install -r requirements.txt
80- ` ` `
81-
82- # ## Running the server for the first time
46+ # ## 🚀 Starting the webserver
8347
84481. Create an SQLite database file with the proper tables:
8549 ` ` ` shell
86- python manage.py migrate
50+ uv run manage.py migrate
8751 ` ` `
88521. Create an admin user for local development:
8953 ` ` ` shell
90- python manage.py createsuperuser
54+ uv run manage.py createsuperuser
9155 ` ` `
9256 It' s easiest to create one with both the username and the password set to "admin", and with no email address.
93571. Run the server:
@@ -96,23 +60,31 @@ and set the following settings (File → Settings...):
9660 which by default should be named "web" and have a tiny Django logo
9761 * Otherwise, run:
9862 ```shell
99- python manage.py runserver [optional port number; defaults to 8000]
63+ uv run manage.py runserver
10064 ```
65+
66+ ### 🧳 Developing offline
67+
68+ When running uv commands, pass [the `--offline` flag](https://docs.astral.sh/uv/reference/cli/#uv-run--offline).
69+ For example:
70+ ```shell
71+ uv run --offline manage.py runserver
72+ ```
10173</details>
10274
10375
104- ## Contribution guidelines
76+ ## 🧑💻 Contribution guidelines
10577
10678See [CONTRIBUTING.md](CONTRIBUTING.md) for the following topics:
10779* [Code style guides](CONTRIBUTING.md#code-style-guides)
10880* [Code review guideline: Code smells](CONTRIBUTING.md#code-review-guideline-code-smells)
10981
11082
111- ## [Wiki](https://github.com/MAKENTNU/web/wiki)
83+ ## 📖 [Wiki](https://github.com/MAKENTNU/web/wiki)
11284[Visit the wiki](https://github.com/MAKENTNU/web/wiki) to read about various things related to development of this project!
11385
11486
115- ## Changelog
87+ ## 📝 Changelog
11688
11789[View the changelog](CHANGELOG.md) to see a list of changes made to the website over time,
11890as well as a superficial description of the release process.
0 commit comments