|
1 |
| -Run Server |
| 1 | +<img src="/assets/core_logo.png" width="400px"> |
2 | 2 |
|
3 |
| -python manage.py runserver |
| 3 | +**Core is the central application that powers many of our online services and events.** |
4 | 4 |
|
5 |
| -Make migrations |
| 5 | +<hr> |
6 | 6 |
|
7 |
| -python manage.py makemigrations PROJECTNAMEHERE |
| 7 | +[](https://github.com/CarletonComputerScienceSociety/Core/blob/master/License) |
| 8 | + |
| 9 | +<hr> |
| 10 | + |
| 11 | +## Table of Contents |
| 12 | +- [Context](#context) |
| 13 | +- [Setup](#setup) |
| 14 | + - [Local](#local) |
| 15 | + - [Docker](#docker) |
| 16 | +- [Applications](#applications) |
| 17 | + - [Code Challenges](#code-challenges) |
| 18 | + - [Resources](#resources) |
| 19 | +- [Commands](#commands) |
| 20 | + |
| 21 | +## Context |
| 22 | + |
| 23 | +Core is a Django based application. We choose Django to build out 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. |
| 24 | + |
| 25 | +#### Services |
| 26 | + |
| 27 | + - Django (Core Application) |
| 28 | + - PostgreSQL |
| 29 | + - RabbitMQ |
| 30 | + - Celery |
| 31 | + |
| 32 | +## Setup |
| 33 | + |
| 34 | +Docker is recommended for application setup due to the high number of services required for this project. |
| 35 | + |
| 36 | +### Local |
| 37 | + |
| 38 | +If you do not have a virtual environment |
| 39 | + |
| 40 | +```bash |
| 41 | +virtualenv venv -p python3 |
| 42 | +``` |
| 43 | + |
| 44 | +Activate virtual environment |
| 45 | + |
| 46 | +```bash |
| 47 | +source venv/bin/activate |
| 48 | +``` |
| 49 | + |
| 50 | +Deactivate virtual environment |
| 51 | + |
| 52 | +```bash |
| 53 | +deactivate |
| 54 | +``` |
| 55 | + |
| 56 | +Start Rabbitmq |
8 | 57 |
|
9 |
| -Migrate |
| 58 | +```bash |
| 59 | +rabbitmq-server |
| 60 | +``` |
10 | 61 |
|
| 62 | +Start Celery Worker |
| 63 | + |
| 64 | +```bash |
| 65 | +celery -A core worker -l info |
| 66 | +``` |
| 67 | + |
| 68 | +Setup Django Application |
| 69 | + |
| 70 | +```bash |
11 | 71 | python manage.py migrate
|
| 72 | +python manage.py runserver 0.0.0.0:8000 |
| 73 | +``` |
| 74 | + |
| 75 | +### Docker |
| 76 | + |
| 77 | +```bash |
| 78 | +docker-compose up |
| 79 | +``` |
| 80 | + |
| 81 | +## Applications |
| 82 | + |
| 83 | +### Code Challenges |
| 84 | + |
| 85 | +The Code Challenges app is used to manage code challenge events. |
| 86 | + |
| 87 | +<br> |
12 | 88 |
|
13 |
| -mhei2ojmkd923eu8i |
| 89 | +<img src="/assets/codechallenges_schema.png" width="800px"> |
| 90 | + |
| 91 | +### Resources |
| 92 | + |
| 93 | +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. |
| 94 | + |
| 95 | +<br> |
| 96 | + |
| 97 | +<img src="/assets/resources_schema.png" width="800px"> |
| 98 | + |
| 99 | +## Commands |
| 100 | + |
| 101 | +Make migrations |
| 102 | + |
| 103 | +```bash |
| 104 | +python manage.py makemigrations PROJECTNAMEHERE |
| 105 | +``` |
14 | 106 |
|
| 107 | +Create superuser in docker |
15 | 108 |
|
16 |
| -docker exec -it f9e0818d9d28 python manage.py createsuperuser |
| 109 | +```bash |
| 110 | +docker exec -it DOCKERCONTAINERID python manage.py createsuperuser |
| 111 | +``` |
0 commit comments