Compare commits

..

2 Commits

View File

@ -11,12 +11,13 @@ Right now it depends on the following non-core Python 3 libraries. These can be
* [easy-thumbnails](https://github.com/SmileyChris/easy-thumbnails) A powerful, yet easy to implement thumbnailing application for Django 1.11+ * [easy-thumbnails](https://github.com/SmileyChris/easy-thumbnails) A powerful, yet easy to implement thumbnailing application for Django 1.11+
* [image](https://github.com/francescortiz/image) Image cropping for django * [image](https://github.com/francescortiz/image) Image cropping for django
* [django-widget-tweaks](https://github.com/jazzband/django-widget-tweaks) Tweak the form field rendering in templates, not in python-level form definitions. * [django-widget-tweaks](https://github.com/jazzband/django-widget-tweaks) Tweak the form field rendering in templates, not in python-level form definitions.
* [django-taggit](https://github.com/jazzband/django-taggit) A simpler approach to tagging with Django.
## Development ## Development
### Setting up a (pipenv) virtual environment for development ### Setting up a (pipenv) virtual environment for development
After having obtained the repository contents (either via .zip download or git clone), you can easily setup a pipenv virtual environment. The repo provides a Pipfile for easy dependency management that does not mess with your system. After having obtained the repository contents (either via .zip download or git clone), you can easily setup a [pipenv](https://docs.pipenv.org/) virtual environment. The repo provides a Pipfile for easy dependency management that does not mess with your system.
``` ```
$ cd lostplaces-backend $ cd lostplaces-backend
@ -25,14 +26,17 @@ $ pipenv shell
(lostplaces-backend) $ lostplaces/manage.py makemigrations (lostplaces-backend) $ lostplaces/manage.py makemigrations
(lostplaces-backend) $ lostplaces/manage.py migrate (lostplaces-backend) $ lostplaces/manage.py migrate
(lostplaces-backend) $ lostplaces/manage.py createsuperuser (lostplaces-backend) $ lostplaces/manage.py createsuperuser
(lostplaces-backend) $ lostplaces/manage.py runserver (lostplaces-backend) $ lostplaces/manage.py runserver --ipv6
``` ```
### Returning to the venv ### Returning to the venv
``` ```
$ cd lostplaces-backend $ cd lostplaces-backend
$ pipenv shell $ pipenv shell
(lostplaces-backend) $ lostplaces/manage.py runserver (lostplaces-backend) $ pipenv update # If dependencies changed, or updates available
(lostplaces-backend) $ lostplaces/manage.py makemigrations # If datamodels changed
(lostplaces-backend) $ lostplaces/manage.py migrate # If datamodels changed
(lostplaces-backend) $ lostplaces/manage.py runserver --ipv6
``` ```
Visit: [admin](http://localhost:8000/admin) for administrative backend or Visit: [admin](http://localhost:8000/admin) for administrative backend or
@ -41,16 +45,15 @@ Visit: [admin](http://localhost:8000/admin) for administrative backend or
## Installing lostplaces ## Installing lostplaces
### Install dependencies ### Install dependencies
Python3, Django3, easy-thumbnails, image, django-widget-tweaks Python3, Django3, easy-thumbnails, image, django-widget-tweaks, django-taggit
``` ```
pip install --user django easy-thumbnails image django-widget-tweaks pip install --user django easy-thumbnails image django-widget-tweaks django-taggit
``` ```
Or, if you use pipenv Or, if you use pipenv
``` ```
pipenv install pipenv install / update
``` ```
### Add 'lostplaces_app' to your INSTALLED_APPS setting like this ### Add 'lostplaces_app' to your INSTALLED_APPS setting like this
``` ```
@ -59,6 +62,7 @@ INSTALLED_APPS = [
'lostplaces_app', 'lostplaces_app',
'easy_thumbnails', 'easy_thumbnails',
'widget_tweaks', 'widget_tweaks',
'django_taggit'
] ]
``` ```
@ -92,11 +96,11 @@ urlpatterns = [
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
``` ```
Run ``python manage.py migrate`` to create the lost places models. Run ``./manage.py migrate`` to create the lost places models.
Start the development server and visit http://127.0.0.1:8000/admin/ Start the development server and visit http://localhost:8000/admin/
Visit http://127.0.0.1:8000/lostplaces/ to CRUD lost places. Visit http://localhost:8000/lostplaces/ to CRUD lost places.
Happy developing ;-) Happy developing ;-)