Skip to content
Snippets Groups Projects
Commit d274eeef authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

adapt README to current setup

parent aacad89b
No related branches found
No related tags found
1 merge request!13Adaptation for an AuRa wide docker setup
...@@ -5,28 +5,32 @@ AURA Steering: Program Scheduler ...@@ -5,28 +5,32 @@ AURA Steering: Program Scheduler
Installation Installation
------------ ------------
If you have a working Docker environment, do:: If you want to have quick dev server and already have the *steering-postgres*
container of the *aura-web* repository running, follow the steps outlined in the
*Setting up the configuration* section and do::
$ docker build -t pv_container . $ docker build -t steering-django --target dev .
$ docker run -p 8000:8000 -d pv_container:latest $ docker run --rm -v $(pwd):/aura --network auraweb_auranet steering-django:latest python manage.py migrate
$ docker run -it --rm -v $(pwd):/aura --network auraweb_auranet steering-django:latest python manage.py createsuperuser
$ docker run --rm -p 8000:8000 -v $(pwd):/aura --network auraweb_auranet steering-django:latest
and log into it at http://127.0.0.1:8000/admin/ with username "admin" and password "admin". Full setup without Docker is done as described below. and log into it at http://127.0.0.1:8000/admin/ with the credentials you have
set in the ``createsuperuser`` step. Once this is done, every other time you
want to start a *steering-django* container, you will only have to use the
last command.
**Full setup without Docker** is done as described below.
To get setup you must have the following installed: To get setup you must have the following installed:
* PostgresSQL or MySQL client development libraries * PostgresSQL (except you are using the aura-web docker container *steering-postgres* for it)
* JPEG library development files * JPEG library development files
* Python 3.8 or later including development files * Python 3.8 or later including development files
In Debian or Ubuntu (or derivatives) you should be able to achieve this with this command: In Debian or Ubuntu (or derivatives) you should be able to achieve this with this command::
* Using PostgreSQL::
$ sudo apt-get install postgresql postgresql-contrib libjpeg-dev python3 python3-dev $ sudo apt-get install postgresql postgresql-contrib libjpeg-dev python3 python3-dev
* Using MySQL::
$ sudo apt-get install libmysqlclient-dev libjpeg-dev python3 python3-dev
Setting up the environment Setting up the environment
-------------------------- --------------------------
...@@ -44,57 +48,21 @@ Change into the base directory of this software and install the project dependen ...@@ -44,57 +48,21 @@ Change into the base directory of this software and install the project dependen
Setting up the configuration Setting up the configuration
---------------------------- ----------------------------
By default the project is set up to run on a SQLite database. Copy the ``.env.example`` file to ``.env`` and change the values accordingly.
You have to at least provide the ``SECRET_KEY`` and the ``DBPASS`` values
Create a file ``pv/local_settings.py`` and add at least the following line:: for Django to start. The file provides extensive comments on all the settings.
For a developments environment the defaults should be just fine if you use the
SECRET_KEY = 'secret key' *steering-postgres* docker container from the *aura-web* repository. If you
want to create your own database on you local machine, you will have to use
(obviously replacing "secret key" with a key of your choice). *steering* as the database and user name, or adopt the ``DB*`` values
accordingly.
Setting up PostgreSQL
---------------------
We recommend using PostgreSQL in order to be able to use the collation utf8mb64_unicode_ci and thus being able to display all languages.
To use PostgreSQL, add the following to your ``local_settings.py`` (before migrating) and add your credentials::
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '5432'
}
}
Setting up MySQL
----------------
**Note:** When adding your database, make sure you **don't** use the collation utf8mb4_unicode_ci or you will get a key length error during migration. (use e.g. utf8_general_ci instead).
To use MySQL, add the following to your ``local_settings.py`` (before migrating)::
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'OPTIONS': {
'read_default_file': os.path.join(PROJECT_DIR, 'mysql.cnf'),
},
}
}
Create a file ``pv/mysql.cnf`` and give your MySQL credentials:: Also be aware that there is a ``RUN_IN_DOCKER`` setting that is ``True`` by
default. This should be fine for a production environment where Django is
run inside a container. If you follow these steps here to create your own
development environment you have to set this setting to ``False``. You also
might want to set ``DEBUG`` to ``True`` for your development environment.
[client]
database =
host = localhost
port = 3306
user =
password =
default-character-set = utf8
Setting up the database Setting up the database
----------------------- -----------------------
...@@ -119,6 +87,8 @@ In development you should run:: ...@@ -119,6 +87,8 @@ In development you should run::
(python)$ python manage.py runserver (python)$ python manage.py runserver
After this you can open http://127.0.0.1:8000/admin in your browser and log in with username "admin" and password "admin". After this you can open http://127.0.0.1:8000/admin in your browser and log in
with the credentials you have chosen in the ``createsuperuser`` command.
Make sure to change your password by visiting http://127.0.0.1:8000/admin/auth/user/1/password/ If you are using some placeholder credentials, make sure to change your password
by visiting http://127.0.0.1:8000/admin/auth/user/1/password/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment