Skip to content

Commit

Permalink
docs: add collectstatic to run-local.md help
Browse files Browse the repository at this point in the history
  • Loading branch information
rmnldwg committed Aug 5, 2024
1 parent 6591db0 commit 9556ff3
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions run-local.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

To use this interface on your machine, you can follow these steps below to get it up and running locally on your computer.


## Cloning the repo

Start by cloning this GitHub repository to you machine. In a terminal enter:
Expand All @@ -13,7 +12,6 @@ git clone https://github.com/rmnldwg/lyprox.git

Afterwards, `cd` into `lyprox`.


## Set up environment

When working with python, it is always recommended setting up a virtual environment. You can create virtual environments in many ways, but here we are going to use [`venv`](https://docs.python.org/3/library/venv.html), which is pretty simple to use and the recommended tool, according to the Python documentation.
Expand Down Expand Up @@ -45,7 +43,6 @@ If everything went according to plan, your terminal should now prefix everything
(.venv) user@machine:~$
```


## Installing prerequisites

In order to start the interface's server, you need to have [django](https://www.djangoproject.com/) along with several other prerequisites installed. The repository is configured such that pip can install all necessary dependencies as if LyProX were a python package:
Expand Down Expand Up @@ -92,34 +89,32 @@ The four variables that need to be set are:
- `DJANGO_ALLOWED_HOSTS`: space-separated list of hostnames. Set to `"localhost 127.0.0.1"` for local use
- `DJANGO_LOG_LEVEL`: log level. Only has an effect in `"debug"` mode. Is set to `"WARNING"` otherwise
[12-factor app]: https://12factor.net/
## Running the interface
Now you should be ready to execute the following commands:
```
python manage.py makemigrations patients accounts
python manage.py migrate
manage.py makemigrations patients accounts
manage.py migrate
manage.py collectstatic
```
This will prepare django's database. If that worked, it is finally time to launch the server locally:
```
python manage.py runserver
manage.py runserver
```
If everything goes according to plan, django will output a link to the locally hosted web server. It usually runs at [http://127.0.0.1:8000/](http://127.0.0.1:8000/).
## Populating the database
Since uploading data (also to the local host) requires an authentication, you will want to create a superuser by running
```
python manage.oy createsuperuser
manage.oy createsuperuser
```
Afterwards you can use the defined credentials to log into the admin page at [http://127.0.0.1:8000/admin](http://127.0.0.1:8000/admin) and edit all database entries.

0 comments on commit 9556ff3

Please sign in to comment.