Note
If your instance runs on the hosted Juntagrico PaaS this installation is done for you. Continue with the basic setup <intro-basic-setup>
.
You may use the cookiecutter template to create your app. This will create an app, with all the required settings set as described in the manual installation. See Cookiecutter for usage.
Then install the requirements with pip
:
$ pip install -r requirements.txt
Further the database and email connection need to be configured using environment variables or directly in the settings.py. Refer to the generated settings.py and the django documentation.
Continue with Initial Django setup <intro-initial-django-setup>
.
Juntagrico is an reusable django app. You should create your own django app and install juntagrico as an app (see below).
See the demo app for reference.
Juntagrico can be installed via pip
:
$ pip install juntagrico
If you used the cookiecutter template, above this settings will already be set. Otherwise refer to the demo application settings.
Add the juntagrico urls to you urls.py e.g.:
# urls.py
from django.urls import path, include
from django.contrib import admin
urlpatterns = [
path('admin/', admin.site.urls),
path('impersonate/', include('impersonate.urls')),
path('', include('juntagrico.urls')),
]
Use the django commands to set up the database e.g.:
$ python -m manage migrate
In production (DEBUG=False
) the static files must be collected e.g.:
$ python -m manage collectstatic
Create a superuser to login into your instance. e.g.:
$ python -m manage createsuperuser
For juntagrico a member needs to be created for the super user using
$ python -m manage create_member_for_superusers
If you want to test juntagrico, these commands will populate your new instance with some example data. Do not do this in production!
Simple example data
$ python -m manage generate_testdata
More complex example data
$ python -m manage generate_testdata_advanced
You should now be able to start the django server and open the instance in the browser e.g.:
$ python -m manage runserver