This is the official website of the Programming Club at UIET, Panjab University.
-
Install postgresql if you haven't already and witch to
postgres
(PostgreSQL administrative user) for performing administrative tasks.sudo su - postgres
-
Log into Postgres session.
psql
-
Create a database for our project.
CREATE DATABASE pclubuietdb;
-
Create a database user.
CREATE USER pclubuietdb WITH PASSWORD 'pclubuietdb'
-
Give access rights of the database to the user.
GRANT ALL PRIVILEGES ON DATABASE pclubuietdb TO pclubuietdb;
-
Exit SQL prompt.
\q
-
Exit out of
postgres
user's shell session.exit
-
Edit your hosts file.
sudoedit /etc/hosts
Add the following entry to the hosts file.
127.0.0.1 pclubuietdb
-
Fork this repository to your account.
-
Create a virtual environment on your machine.
virtualenv -p python3 env
We recommend using python3-virtualenv. Any other packages would do fine though.
-
Activate the newly created virtual environment.
cd env source bin/activate
-
Clone this repository (this would make rebasing easier).
git clone https://github.com/pclubuiet/website.git
-
Install the dependencies for the project.
cd website pip3 install -r requirements.txt
-
Change
DEBUG=True
in /pclubWebsite/settings.py file (DO NOT COMMIT this change to settings.py in your PRs). -
Run the migrations and collect static files.
python3 manage.py migrate python3 manage.py collectstatic
-
Run the live development server on your machine and test it.
python3 manage.py runserver
Once the server is started, open http://127.0.0.1:8000/home in a web browser. Everything went well if the webpage loads correctly and you don't see any errors.
-
Add a remote to your forked repository. This remote will be needed to push your changes to your repo.
git remote add myfork https://github.com/<username>/website.git
Prerequisites:
- Ensure you have Docker Engine installed. For installation steps head to https://docs.docker.com/engine/installation/.
- Ensure you have Docker Compose installed. For installation steps head to https://docs.docker.com/compose/install/.
-
Start and aggregate logs from containers to console.
docker-compose up
To stop press
CTRL+C
-
Start in background
docker-compose up -d
To stop:
docker-compose stop
If you want to force Compose to stop and recreate all containers, use the --force-recreate
flag.
After selecting an issue
- Comment on the issue saying that you are working on the issue.
- We expect you to discuss the approach by comments.
- Updates or progress on the issue would be nice.
-
Create a new branch and switch to it (make sure you are on master before doing this).
git branch mybranch git checkout mybranch
'mybranch' can be replaced by your preferred name for the branch. The above two commands are equivalent to the following
git checkout -b mybranch
-
Make your changes and then execute the tests to make sure you didn't break anything.
python3 manage.py test
Ensure that you follow PEP8 style guide for python code while naming functions or classes.
Then stage them and commit them. Check out Chris Beams's guide to writing good commit messages here.
A small description of your changes is must in the commit messages.
-
After you are done making changes, push the branch to your fork.
git push -u myfork mybranch
The -u option is required only the first time you push the branch.
Make sure your branch is up-to-date with the latest version of the master. Else you are required to do a rebase to place your changes above master branch.
- Please help us follow the best practice to make it easy for the reviewer as well as the contributor. We want to focus on the code quality more than on managing pull request ethics.
- Single commit per pull request
- For writing commit messages please adhere to the Commit style guidelines.
- Follow uniform design practices.
- The pull request will not get merged until and unless the commits are squashed. In case there are multiple commits on the PR, the commit author needs to squash them and not the maintainers cherrypicking and merging squashes.
- If the PR is related to any front end change, please attach relevant screenshots in the pull request description o
Once a PR is opened, try and complete it within 2 weeks, or at least stay actively working on it. Inactivity for a long period may necessitate a closure of the PR. As mentioned earlier updates would be nice.
Deploy to heroku using the badge provided above and post the link in the description of your PR.
Your code will be reviewed, in this sequence, by:
- Travis CI: by building and running tests. If there are failed tests, the build will be marked as a failure. You can consult the CI log to find which tests. Ensure that all tests pass before triggering another build.
- Reviewer: A core team member will review your pull request and approve it or he will suggest changes.
If you have the time and the knowledge then you must review other Pull Requests. This would stop Pull Requests from stacking up and will definitely mean your Pull Request would be reviewed faster.
Things to keep in mind while reviewing a Pull Request:
If any of the following questions has a YES for an answer then the request shall NOT be approved.
- Will the referenced issue NOT be fixed with the Pull Request?
- Is the commit message NOT good?
- Are there unnecessary changes?
- Is a rebase required?
- Is the fix dirty / hacky?
This website is licensed under GPL V3+