Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nearbyshops/nearbyshops/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/

STATIC_URL = "/static/"

DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
21 changes: 20 additions & 1 deletion nearbyshops/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,24 @@

This folder contains the bonus material & example projects for our [Make a Location-Based Web App With Django and GeoDjango](https://realpython.com/location-based-app-with-geodjango-tutorial) tutorial on Real Python.

Check out [Make a Location-Based Web App With Django and GeoDjango](https://realpython.com/location-based-app-with-geodjango-tutorial/) for more information.
Check out [Make a Location-Based Web App With Django and GeoDjango](https://realpython.com/location-based-app-with-geodjango-tutorial/) for more information.

## Requirements

- Python 3.12 or later
- GDAL, GEOS, and PROJ installed on your system
- A PostgreSQL database with the PostGIS extension, for example:

```console
$ docker run --name=postgis -d -e POSTGRES_USER=user001 \
-e POSTGRES_PASS=123456789 -e POSTGRES_DBNAME=gis \
-p 5432:5432 kartoza/postgis:18-3.6
```

Install the Python dependencies, then load the data and run the server:

```console
$ python -m pip install -r requirements.txt
$ python manage.py migrate
$ python manage.py runserver
```
2 changes: 2 additions & 0 deletions nearbyshops/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
django==6.1.1
psycopg2-binary==2.9.13
4 changes: 2 additions & 2 deletions nearbyshops/shops/admin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Register your models here.

from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
from django.contrib.gis.admin import GISModelAdmin

from .models import Shop


@admin.register(Shop)
class ShopAdmin(OSMGeoAdmin):
class ShopAdmin(GISModelAdmin):
list_display = ("name", "location")
Loading