diff --git a/.kearc b/.kearc new file mode 100644 index 0000000..d4ff287 --- /dev/null +++ b/.kearc @@ -0,0 +1,5 @@ +{ + "tsConfigPath": "./tsconfig.json", + "rootPath": "./src", + "typesPath": "./src" +} diff --git a/README.md b/README.md index 0075b40..0a032b5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The code for the server is located in the [`backend`](./backend) directory. -**Install dependencies** +### 1. Install dependencies** 1. Install [Postgres.app](https://postgresapp.com/) and follow the [instructions](https://postgresapp.com/documentation/install.html) to add it to your path. @@ -24,7 +24,8 @@ export GDAL_LIBRARY_PATH=/opt/homebrew/lib/libgdal.dylib export GEOS_LIBRARY_PATH=/opt/homebrew/lib/libgeos_c.dylib ``` -**Create database & Role** +### 2. Create database and start backend + ``` psql CREATE DATABASE whereintheworld; @@ -40,15 +41,14 @@ python manage.py cities --import=all python manage.py runserver ``` -The server is now running at [`http://localhost:3001/`](http://localhost:3001/). +The server is now running at [`http://localhost:8000/`](http://localhost:8000/). -### 3. Start the app (frontend) +### 3. Start the frontend -The code for the Next.js app is located in the [`frontend`](./frontend) directory. Once you launched the server, you can start it as follows: +The code for the frontend is located in the [`src`](./src) directory. Once you launched the server, you can start it as follows: ``` -cd ../frontend -yarn install +yarn yarn start ``` diff --git a/backend/settings.py b/backend/settings.py index a080c22..1abf275 100644 --- a/backend/settings.py +++ b/backend/settings.py @@ -142,13 +142,17 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.2/howto/static-files/ + +STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles") STATIC_URL = "/static/" +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, "build/"), +] -# TODO: Temporary TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", - "DIRS": ["frontend/dist", "backend/templates"], + "DIRS": ["build", "backend/templates"], "APP_DIRS": True, "OPTIONS": { "context_processors": [ diff --git a/backend/templates/index.html b/backend/templates/index.html index d42091e..d75f2d8 100644 --- a/backend/templates/index.html +++ b/backend/templates/index.html @@ -3,5 +3,5 @@