A GitHub issue tracker to follow GitHub issues with django and Django Rest Framework.
This is a list of mostly used technologies and libraries that are used in project:
-
Python is an interpreted high-level programming language for general-purpose programming.
-
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
-
Django Rest Framework is a powerful and flexible toolkit for building Web APIs.
-
PostgreSQL is a free and open-source relational database management system emphasizing extensibility and SQL compliance.
-
Redis is an open source, in-memory data structure store, used as a database, cache, and message broker
-
Docker is an application build and deployment tool. It is based on the idea of that you can package your code with dependencies into a deployable unit called a container.
-
Celery is an asynchronous task queue/job queue based on distributed message passing.
-
MailHog is an email testing tool for developers.
This project are used docker to run the project, download docker here if you haven't done so. Docker can't help for some devices. If the project does not work with Docker, Docker Toolbox will help you.
In order to easy the use of Docker commands, the project has a Makefile that encapsulates the commands you'll need.
Before running the project, create your own environment file (.env
). Simply run the following command, and edit the variables:
cp .env.sample .env
To use the GitHub API, you need to create a GitHub API token. You can create a token by following the steps below:
- Go to your GitHub account settings.
- Click on Developer settings.
- Click on Personal access tokens.
- Click on Tokens (classic).
- Click on Generate new token.
- Give a name to the token and select the scopes you need. (In actually you don't need any scope on this project because public repositories are accessible without permissions. But if you want to access private repositories, you need to select the appropriate scopes.)
- Click on Generate token.
- Copy the token and paste it to the
.env
file asGITHUB_API_TOKEN
. - Save the
.env
file.
To build the project, run the following command:
make build
To run the project, run the following command:
make up
To create a superuser, run the following command:
make django createsuperuser
This user will be used to login to the Django admin panel and to access the API.
You can use that user to login and follow the repositories.
To access the Django admin panel, go to http://localhost:8000/admin and login with the superuser credentials.
To access the API, go to http://localhost:8000/api.
You can see the list of all active API endpoints.
To access the API documentation, go to http://localhost:8000/api/schema/redoc/.
And also you can access the Swagger documentation by going to http://localhost:8000/api/schema/swagger-ui/.
In every 1 hour, the project checks the repositories you followed and sends an email if there is an issue created or updated.
("gissues.extensions.github_client.tasks.CheckForNewIssues" task is responsible for this.)
You can change the schedule time by set the 'CHECK_FOR_NEW_ISSUES_INTERVAL_IN_MINUTES' in the .env
file.'
Also, you can check the celery tasks by going to http://localhost:5555.
And you can see the emails that are sent by the project by going to http://localhost:8025.
Command | Explanation |
---|---|
up | Build the containers if not done so, then run them. The logs of all containers will be streamed while the script is running. You can terminate the script to stop the containers. |
down | Stop all containers and purge all the data in them. |
build | Build the containers. |
restart | Restart the containers. |
start | Start all containers. |
stop | Stop all containers. |
shell | Enter the Python shell in Django container. |
test | Run tests. |
mypy | Run mypy type checking. |
changelog | Generate a changelog based on the commit messages.(requires git-cliff to be installed in local environment) |
logs | Stream all container logs. |
compile-requirements | Compile Poetry requirements and dump it into requirements.txt (requires Poetry to be installed in local environment) |
django | Run Django commands. You can add your command in order. |
- Ömer Faruk Korkmaz