-
Notifications
You must be signed in to change notification settings - Fork 41
Development
IMPORTANT!
- First, you'll need to FORK this repository onto your own GitHub account.
- You can find the button to Fork in the top-right corner of this page.
- > Read more information about Forking a Repository here <
- Once you have the repo forked, you can either clone your new repo locally, or work on it directly in Gitpod.
- NOTE: don't click the Gitpod button on this repository, you will have errors pushing any changes.
- > A demo of these steps can be found on this video from our Workshop call (15OCT2020) <
Please ensure development is done within a virtual environment, whether locally or on Gitpod.
Our current preference is to have contributors work directly in Gitpod, to avoid any possible implications that may arise from not using a virtual environment.
In order to run this project locally on your own system, you will need the following installed (as a bare minimum):
- Python3 to run the application.
- PIP to install all app requirements.
- GIT for cloning and version control.
- Microsoft Visual Studio Code (or any suitable IDE).
Next, there's a series of steps to take in order to proceed with development:
- Create a
.envfile with the specified variables.touch .env- View our example .env_sample file for reference.
- Install all requirements from the requirements.txt file:
pip3 install -r requirements.txt
- Make sure to checkout into an appropriate branch. Never develop onto the master branch.
-
git branch -a(view existing branches) -
git checkout -b new_branch_name(create new branch) -
git checkout branch_name(go to an existing branch)
-
- Ensure that you have both origin and upstream remotes on your forked project.
-
git remove -v(view the remotes)
-
- Pull any updates from the master upstream branch, onto your current branch:
git pull upstream master
- Launch the Django project:
python3 manage.py runserver
- The Django server should be running (either locally, or on Gitpod).
- When you run the Django server for the first time, it should create a new SQLite3 database file: db.sqlite3
- Next, you will need to make migrations to create the database schema:
-
CTRL+C(stop the app) python3 manage.py makemigrationspython3 manage.py migrate
-
- In order to access the Django Admin Panel, you must generate a superuser:
python3 manage.py createsuperuser- (assign your own admin username, email, and secure password)
- Launch the Django project once again:
python3 manage.py runserver
Once the database migrations and superuser have been successfully completed, Django should migrate the existing migrations.py files from each app to configure the following schema:

User (django.contrib.auth)
id: <IntegerField> (PK)
username: <CharField> (UNIQUE)
email: <CharField>
first_name: <CharField>
last_name: <CharField>
is_staff: <BooleanField>
is_superuser: <BooleanField>
Hackathon (models.Model)
id: <IntegerField> (PK)
created: <DateTimeField>
updated: <DateTimeField>
created_by: User (FK)
display_name: <CharField>
description: <TextField>
start_date: <DateTimeField>
end_date: <DateTimeField>
awards: HackAwardCategory (FK)
teams: HackTeam (FK)
judges: User (FK)
organizer: User (FK)
HackTeam (models.Model)
id: <IntegerField> (PK)
created: <DateTimeField>
updated: <DateTimeField>
created_by: User (FK)
display_name: <CharField>
participants: User (FK)
project: Project (FK)
HackProject (models.Model)
id: <IntegerField> (PK)
created: <DateTimeField>
updated: <DateTimeField>
created_by: User (FK)
display_name: <CharField>
description: <TextField>
githubLink: <CharField>
collabLink: <CharField>
submissionTime: <DateTimeField>
scores: HackProjectScore (FK)
mentor: User (FK)
HackProjectScore (models.Model)
id: <IntegerField> (PK)
created: <DateTimeField>
updated: <DateTimeField>
created_by: User (FK)
judge: User (FK)
score: HackProjectScoreCategory (FK)
HackProjectScoreCategory (models.Model)
id: <IntegerField> (PK)
created: <DateTimeField>
updated: <DateTimeField>
created_by: User (FK)
category: <CharField>
score: <IntegerField>
HackAwardCategory (models.Model)
id: <IntegerField> (PK)
created: <DateTimeField>
updated: <DateTimeField>
created_by: User (FK)
display_name: <CharField>
description: <TextField>
winningProject: HackProject (FK)
- Once you're happy with all changes, you can commit and push your code to the appropriate branch:
git add <files>git commit -m "#ID: Your commit message details"git push origin <BRANCH_NAME>- reminder: do not attempt to push to the master branch!
- Finally, you will need to open a Pull Request on GitHub, detailing all required information:
- From your forked repo, the PR should look something like this:
- base repository: Code-Institute-Community/ci-hackathon-app
- base: master
- head repository: your-own-account/forked repo
- compare: your-own-branch
- From your forked repo, the PR should look something like this:
- If you've added code that should be tested, please attempt to add the required tests.
- Make sure you address any known issues/bugs/warnings/errors.
- If you make visual changes, please include tested screenshots.
- If you make any existing code better, please let us know in your PR description.
- If contributing to specific User Stories, please be sure to include the appropriate User Story ID.
- #M01 (Miscellaneous User Story #01)
- #P02 (Participant User Story #02)
- #S03 (Staff User Story #03)
- #A04 (Admin User Story #04)
Happy Coding, and thanks for Contributing to the Code Institute Community!