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 virtualenvvirtualenv venv -p python3For unix
source venv/bin/activateFor windows
venv\Scripts\activateYou will also need to know how to deactivate your virtual environment later, which can be done by running the following:
deactivatepip install -r requirements.txtCurrently 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.devFor windows
set DJANGO_SETTINGS_MODULE=core.settings.devpython manage.py migratepython manage.py runserver 0.0.0.0:8000rabbitmq-servercelery -A core worker -l infoEverything in this application is preconfigured to use host names from our docker-compose.yml.
docker-compose upThe 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 PROJECTNAMEHEREMake superuser
python manage.py createsuperuserCreate superuser in docker
docker exec -it DOCKERCONTAINERID python manage.py createsuperuserLint using Black
black .

