Compare commits
	
		
			5 Commits
		
	
	
		
			0.1
			...
			5c5ad9502c
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 5c5ad9502c | |||
| baf3f54e1a | |||
| 8cb7e61274 | |||
| fa1274c595 | |||
| a5839c2c36 | 
							
								
								
									
										63
									
								
								Readme.md
									
									
									
									
									
								
							
							
						
						
									
										63
									
								
								Readme.md
									
									
									
									
									
								
							| @@ -9,6 +9,8 @@ Right now it depends on the following non-core Python 3 libraries. These can be | |||||||
|  |  | ||||||
|   * [django](https://www.djangoproject.com/) django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. |   * [django](https://www.djangoproject.com/) django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. | ||||||
|   * [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 djanbgo | ||||||
|  |   * [django-widget-tweaks](https://github.com/jazzband/django-widget-tweaks) Tweak the form field rendering in templates, not in python-level form definitions. | ||||||
|  |  | ||||||
| ### Setting up a (pipenv) virtual environment for development | ### Setting up a (pipenv) virtual environment for development | ||||||
|  |  | ||||||
| @@ -33,4 +35,65 @@ $ pipenv shell | |||||||
| Visit: [admin](http://localhost:8000/admin) for administrative backend or | Visit: [admin](http://localhost:8000/admin) for administrative backend or | ||||||
| [frontend](http://localhost:8000/) | [frontend](http://localhost:8000/) | ||||||
|  |  | ||||||
|  | ## Installing lostplaces | ||||||
|  |  | ||||||
|  | ### Install dependencies | ||||||
|  | Python3, Django3, easy-thumbnails, image, django-widget-tweaks | ||||||
|  | ``` | ||||||
|  | pip install django easy-thumbnails image django-widget-tweaks | ||||||
|  | ``` | ||||||
|  | Or, if you use pipenv | ||||||
|  | ``` | ||||||
|  | pipenv install | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### Add 'lostplaces_app' to your INSTALLED_APPS setting like this | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | INSTALLED_APPS = [ | ||||||
|  | 	... | ||||||
|  | 	'lostplaces_app', | ||||||
|  | 	'easy_thumbnails', | ||||||
|  | 	'widget_tweaks', | ||||||
|  | ] | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ### Add this configuration to your settings.py | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | from django.urls import reverse_lazy | ||||||
|  | ... | ||||||
|  | AUTH_USER_MODEL = 'lostplaces_app.Explorer' | ||||||
|  |  | ||||||
|  | LOGIN_URL = reverse_lazy('login') | ||||||
|  |  | ||||||
|  | THUMBNAIL_ALIASES = { | ||||||
|  | 	'': { | ||||||
|  | 		'thumbnail': {'size': (300, 300), 'crop': False}, | ||||||
|  | 		'hero': {'size': (700, 700), 'crop': False}, | ||||||
|  | 		'large': {'size': (1920, 1920), 'crop': False}, | ||||||
|  | 	}, | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ### Include the lostplaces URLconf in your project urls.py like this | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | from django.urls import path, include | ||||||
|  | ... | ||||||
|  | urlpatterns = [ | ||||||
|  | 	... | ||||||
|  | 	path('lostplaces/', include('lostplaces_app.urls')), | ||||||
|  | ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | Run ``python manage.py migrate`` to create the lost places models. | ||||||
|  |  | ||||||
|  | Start the development server and visit http://127.0.0.1:8000/admin/ | ||||||
|  |  | ||||||
|  | Visit http://127.0.0.1:8000/lostplaces/ to CRUD lost places. | ||||||
|  |  | ||||||
|  |  | ||||||
| Happy developing ;-) | Happy developing ;-) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user