Skip to content

Latest commit

 

History

History
115 lines (67 loc) · 3 KB

installation.rst

File metadata and controls

115 lines (67 loc) · 3 KB

Installation

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>.

Manual Installation

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

Django Settings

If you used the cookiecutter template, above this settings will already be set. Otherwise refer to the demo application settings.

Hook URLs in URLconf

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')),
]

Initial Django setup

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

Create Test Data (optional)

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

Run the Server

You should now be able to start the django server and open the instance in the browser e.g.:

$ python -m manage runserver