Package: django-lostplaces
lostplaces-backendlostplaces-backend is a django (3.x) based webproject. It once wants to become a software which allows a group of urban explorers to manage, document and share the locations of lost places while not exposing too much / any information to the public.The software is currently in early development status, neither scope, datamodel(s) nor features are finalized yet. Therefore we would not recommend to download or install this piece of software anywhere - except your local django dev server.We value privacy as a whole, all resources the frontend requires will be shipped with lostplace's distribution. We also try to minimize the use of JavaScript as far as we can and try to offer JS-less alternatives where we can.ContactIf you run into any issues, have any questions or If you are interested in this project in general, feel free to get in touch with us viareverend@reverend2048.de, we do speak English and German.FeaturesManage lost places with lots of useful information.OSM-MapsSensitive information is not accessible for anonymous (not logged in) users.User self registration using a voucher system, only people you invite can join your instance.Collaboration, every user can add informations like tags, photos and external links to your place.DependenciesRight now it depends on the following non-core Python 3 libraries. These can be installed using the package manager of your distribution or into the venv locally.djangois a high-level Python Web framework that encourages rapid development and clean, pragmatic design.easy-thumbnailsA powerful, yet easy to implement thumbnailing application for Django 1.11+.imageImage cropping for django.django-widget-tweaksTweak the form field rendering in templates, not in python-level form definitions.django-taggitA simpler approach to tagging with Django.Bundled DependenciesWe also leverage some other great OpenSource projects' code. We bundle those in the distribution to obsolete the need to pull those files from monitored CDNs.OpenLayers[6.4.3] OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles, vector data and markers loaded from any source.Crimson Pro font[1.002] Crimson Pro is a serif typeface family: Contemporary, clear, classic and rounded/open.Montserrat[7.210] A beautiful sans serif typeface.Installing a development instanceClone the repositorygit clone https://git.commander1024.de/Commander1024/lostplaces-backendSetting up a (pipenv) virtual environment for developmentAfter having obtained the repository contents (either via .zip download or git clone), you can easily setup apipenvvirtual environment. The repo provides a Pipfile for easy dependency management that does not mess with your system.$cdlostplaces-backend
$pipenvinstall$pipenvshell(lostplaces-backend)$django_lostplaces/manage.pymakemigrations(lostplaces-backend)$django_lostplaces/manage.pymigrate(lostplaces-backend)$django_lostplaces/manage.pycreatesuperuser(lostplaces-backend)$django_lostplaces/manage.pyrunserver--ipv6Returning to the venv$cdlostplaces-backend
$pipenvshell(lostplaces-backend)$pipenvupdate# If dependencies changed, or updates available(lostplaces-backend)$django_lostplaces/manage.pymakemigrations# If datamodels changed(lostplaces-backend)$django_lostplaces/manage.pymigrate# If datamodels changed(lostplaces-backend)$django_lostplaces/manage.pyrunserver--ipv6Visit:adminfor administrative backend orfrontend.Happy developing ;-)Pipenv ScriptsThis project comes with a bunch of convinient scripts, like:ScriptDescriptiontestRuns the testsserverStarts adevelopmentserverdbshellOpens a shell session in the databaseshowmigrationsLists all MigrationsmakemigrationsCreates a migrationmigrateApplies unapplied migrationsbuildBuilds this project into a wheel filecreatesuperuserCreates a superuser with the usernameadminand the passworddevelop. This is for development and demo instances only!quickstartRunsmigrate,createsuperuserandserverInstalling a productive instanceCurrently there are two ways to deploy the lostplaces project:Cloning this repository, including the configured django instance.Install the package and setup the django instance yourself.Cloning the repositoryEssentially, this is the same as installing a development instance, but without the development server (manage.py runserver) and something powerful (Apache, NGINX) instead. You have to configure the webserver to work with the *SGI Api respectively, referencedjango's guide for deploymentfor further information.You also should setup a dedicated database server, the built-in SQLite file is not recommended for production use. Referencedjango's guide for databasesfor further information.Before making the django instance public, you should tweak the configsettings.py:Change the secret key, the one found in the config is already public. Choose something secure (i.e.this).Turn off debug mode by settingDEBUG = False.Tune the localization settings, seedjango's documentation.Rundjango_lostplaces/managy.py collectstaticand you should be ready to go.Installing lostplaces to an existing django instanceInstalling django and the django_lostplaces appIf you haven't already setup a django instance, seedjango's documentation.Afterwards, eitherdownload the desired releasefrom the releases pageand install it usingpip install --user name-of-the-file.tar.gzor install the latest release usingpip install django-lostplacesNote: You can run pip install without the --user flag, which will require root privileges and introduces potential security issues.Configuring the django instanceNow configure yoursettings.pyas follows:Add the following apps to the django project.INSTALLED_APPS=[...'django_lostplaces','easy_thumbnails','widget_tweaks','django_taggit']Set the URL's and Root-directories for file handling, for example:STATIC_URL='/static/'STATIC_ROOT=os.path.join(BASE_DIR,'static_files')MEDIA_URL='/uploads/'MEDIA_ROOT=os.path.join(BASE_DIR,'uploads')Set the URL's for login, for example:LOGIN_URL=reverse_lazy('login')LOGIN_REDIRECT_URL=reverse_lazy('django_lostplaces_home')LOGOUT_REDIRECT_URL=reverse_lazy('django_lostplaces_home')Configuring the URL'sIn theurls.pyconfigure theurlpatternslike this:urlpatterns=[path('admin/',admin.site.urls),path('signup/',SignUpView.as_view(),name='signup'),# If you want to use lostplaces' sign up view.path('explorers/',include('django.contrib.auth.urls')),# You can change the 'explorers/' to whatever you desire.path('',include('django_lostplaces.urls')),# In this configuration django_lostplaces will be at the top level of you website, change '' to 'django_lostplaces/', if you don't want this.]+static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)# So django can deliver user uploaded files.Before making the django instance public, you should tweak the configsettings.py:Change the secret key, the one found in the config is already public. Choose something secure (i.e.this).Turn off debug mode by settingDEBUG = False.Tune the localization settings, seedjango's documentation.Set a new (random) SECRET_KEY in settings.py, e. g.:base64 /dev/urandom | head -c50Rundjango_lostplaces/manage.py collectstaticyou should be ready to go.