Skip to content

sitn/sitn_applications

Repository files navigation

sitn_applications

Apps and custom webservices from SITN. This app can run in two different contexts: internet or intranet. Depending on the context, some apps will not be installed when deploying.

Requirements

Getting started

Fork and clone this repository. Make a copy of the .env.sample file and adapt it to your environment settings:

cp .env.sample .env

and configure the different variables.

Running in development mode, without docker

First, create a copy of the .env.sample file called .env:

cp .env.sample .env

Install and activate the virual environment:

python -m venv venv
./venv/Scripts/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

Create a local database:

python manage.py createdb

Run migrations

python manage.py migrate

Dump some fresh data from prod database

python manage.py getdata

You might want to create an admin user:

python manage.py createsuperuser

You're now ready to go:

python manage.py collectstatic
python manage.py compilemessages --locale=fr
python manage.py runserver

Switching between the Internet & Intranet instances

If developping on the Internet instance, then you should define a new environment variable in the .env.dev. file:

IS_INTRANET=False

Running locally on Docker

First, create a copy of the env.sample file called env.<context>.local:

cp .env.sample .env.intranet.local

Then you'll be able to deploy locally on docker:

python deploy intranet local

Deploying on production

First, create a copy of the env.sample file called env.<context>.<instance>, example:

cp .env.sample .env.intranet.prod

Then you'll be able to deploy your instance with python deploy <context> <instance>

python deploy intranet prod

Tests

Running tests will require a database for testing.

python manage.py testdb

then you can run tests

python manage.py test --keepdb

Translations

Prepare translation files

django-admin makemessages -l fr

then compile them

python manage.py compilemessages --locale=fr

Starting a new app

python manage.py startapp myapp

Then:

  1. Put something in urls.py in your app folder
  2. Import your urls in sitn/urls.py
  3. Install the app in settings.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •