Skip to content

Commit

Permalink
Getting started:
Browse files Browse the repository at this point in the history
- update the readme
- add DB init script
  • Loading branch information
marionb committed Feb 26, 2024
1 parent 67d5ef0 commit 5677eb5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,34 @@ WITH unaccent, simple;

Now that the database is ready, you can start backend either with Docker or not.

### Run dev server without docker on a Linux based machine

- Create a virtual python environment and install the requirements.txt

- run the migrations on the DB and collectstatic:

```
python manage.py migrate
python manage.py collectstatic
```
- Create admin account and Extract group with permissions
```
python manage.py fixturize
```
- Create a super user:
```
python manage.py createsuperuser
```
- Run the application:
```
python3 manage.py runserver
```
Access the application under the indicated address
### Run dev server without docker on Windows
You'll need to configure 3 paths to your GDAL installation according to `.env.sample`.
Expand All @@ -57,7 +85,7 @@ Then, we're going to:
* Run migrations
* Collect static files for the admin interface
* Generate translations for your langage
* Generate translations for your language
* Add minimal users to database
```shell
Expand Down
15 changes: 15 additions & 0 deletions db/docker_db/init-scripts/01_init_db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- CREATE ROLE geoshop WITH LOGIN PASSWORD geoshop;
--
-- CREATE DATABASE geoshop OWNER geoshop;
-- REVOKE ALL ON DATABASE geoshop FROM PUBLIC;

CREATE EXTENSION postgis;
CREATE EXTENSION unaccent;
CREATE EXTENSION "uuid-ossp";

CREATE SCHEMA geoshop AUTHORIZATION geoshop;

CREATE TEXT SEARCH CONFIGURATION fr (COPY = simple);

ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING FOR hword, hword_part, word
WITH unaccent, simple;

0 comments on commit 5677eb5

Please sign in to comment.