Core is the central application that powers many of our online services and events.
Core is a Django based application. We used Django to build this application because of Django's "app based" structure and Django's preconfigured dashboard system. The hope is that to avoid having to configure and run several microservices, we can instead create new Django apps.
- Django (Core Application)
- PostgreSQL
- RabbitMQ
- Celery
Docker is recommended for application setup due to the high number of services required for this project.
pip install virtualenv
virtualenv venv -p python3
For unix
source venv/bin/activate
For windows
venv\Scripts\activate
You will also need to know how to deactivate your virtual environment later, which can be done by running the following:
deactivate
pip install -r requirements.txt
Currently this application uses a postgres database, but for local development if may be quicker for you to use SQLite.
Open core/settings/base.py
If you would like to use SQLite, uncomment the SQLite config. If you would like to use postgres, enter your postgres information.
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': 'ccss_resources',
# 'USER': 'postgres',
# 'PASSWORD': '1234',
# 'HOST': 'ccss_resources_db',
# 'PORT': 5432,
# }
# }
For unix
export DJANGO_SETTINGS_MODULE=core.settings.dev
For windows
set DJANGO_SETTINGS_MODULE=core.settings.dev
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
rabbitmq-server
celery -A core worker -l info
Everything in this application is preconfigured to use host names from our docker-compose.yml.
docker-compose up
The Code Challenges app is used to manage code challenge events.
The Resources app controls the dynamic content on the CCSS website. This app was created so volunteers could easily populate the website with resources, links, jobs postings and more.
Make migrations
python manage.py makemigrations PROJECTNAMEHERE
Make superuser
python manage.py createsuperuser
Create superuser in docker
docker exec -it DOCKERCONTAINERID python manage.py createsuperuser
Lint using Black
black .