{"id":28163778,"url":"https://github.com/ryuga/department-website","last_synced_at":"2025-05-15T11:14:36.307Z","repository":{"id":200084155,"uuid":"376605418","full_name":"Ryuga/Department-Website","owner":"Ryuga","description":"Website with Event Management System build with Django, JQuery and Bootstrap for Department of Computer Science, Christ College Irinjalakuda. ","archived":false,"fork":false,"pushed_at":"2025-01-17T17:52:24.000Z","size":14325,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-27T13:28:38.440Z","etag":null,"topics":["ajax","bootstrap5","django","jquery","nginx"],"latest_commit_sha":null,"homepage":"https://christcs.in","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ryuga.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-13T17:44:28.000Z","updated_at":"2025-01-10T07:37:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e78afd9-f932-42ff-bae7-93ac67e3d5bd","html_url":"https://github.com/Ryuga/Department-Website","commit_stats":null,"previous_names":["ryuga/department-website"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryuga%2FDepartment-Website","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryuga%2FDepartment-Website/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryuga%2FDepartment-Website/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryuga%2FDepartment-Website/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ryuga","download_url":"https://codeload.github.com/Ryuga/Department-Website/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254328388,"owners_count":22052633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","bootstrap5","django","jquery","nginx"],"created_at":"2025-05-15T11:14:28.236Z","updated_at":"2025-05-15T11:14:36.294Z","avatar_url":"https://github.com/Ryuga.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Website for the Department of Computer Science\n## Christ College (Autonomous) Irinjalakuda\n\n## Setup instruction\n\n\n#### You would need a linux system for development. Windows raises python-decouple errors. More info [here](https://github.com/ryuga/Department-Website/issues/1).\n#### You need Python 3.8 or above installed on your system.\n\n\n### Development Setup\n```bash\n# Clone the repository or download as zip and cd into the root folder (Department-Website)\n# Terminal instructions (You're supposed run the below commands during the initial setup)\n\n# Remove existing virtualenv module, We will let poetry install the required version\n$ sudo apt-get remove virtualenv -y \u0026\u0026 sudo python3 -m pip uninstall virtualenv -y\n\n# Install poetry\n$ pip install poetry\n\n# Install dependencies from poetry\n$ poetry install\n\n$ sudo nano .env\n# add the following environment variables\n\nDATABASE_URL = your_database_url\n\nDEBUG = True\nLOCAL_DEVELOPMENT = True\nSECRET_KEY = \"your_secret_key\"\nDASHBOARD_URL = \"your_dashboard_url\"\nENCRYPTION_SALT = \"your_encryption_salt\"\nENCRYPTION_ITERATION = your_iteration_count\n\n\nPAYTM_MERCHANT_ID = \"your_merchant_id\"\nPAYTM_MERCHANT_KEY = \"your_merchant_key\"\n\nGOOGLE_CLIENT_ID = \"your_client_id\"\nGOOGLE_CLIENT_SECRET = \"your_client_secret\"\n\nPAYTM_PROCESS_TRANSACTION_URL = \"https://securegw-stage.paytm.in/theia/processTransaction\"\n\n# Run the development server locally\n$ poetry run python3 manage.py runserver \n# this should run the Django development server on your localhost:8000.\n# now you can visit http://127.0.0.1:8000 and access the site.\n```\n\n### Adding host file configuration for subdomain access in development\n\n### Production Setup\n\n#### Dokku Setup\n```bash\n# Update and upgrade apt\n$ sudo apt-get update \u0026\u0026 sudo apt-get upgrade -y\n\n# Fetch dokku 0.31.4\n$ wget -NP . https://dokku.com/install/v0.31.4/bootstrap.sh\n\n# Install dokku\n$ sudo DOKKU_TAG=v0.31.4 bash bootstrap.sh\n\n# Create dokku application\n$ dokku apps:create department-website\n\n# Add required buildpacks\n$ dokku buildpacks:add department-website https://github.com/moneymeets/python-poetry-buildpack.git\n$ dokku buildpacks:add department-website https://github.com/heroku/heroku-buildpack-python.git\n\n# From the above .env file, add all the variables and their values in given format\n# (Multiple variables and their values can be added at a time with spaces between each pair)\n$ dokku config:set department-website VARIABLE_NAME=VALUE\n\n# Explicitly disable static file collection\n$ dokku config:set department-website DISABLE_COLLECTSTATIC=1\n```\n\nAdd Github repository \n\n#### Baremetal Setup\n\n#### Addition Requirements:\n\n[NGINX](https://nginx.org/en/): Webserver for handling requests and serving django assets.\n\n[Supervisor](http://supervisord.org/): Process management tool for keeping Django running. It also provides logging in events of unaccounted crashes and restarts the application to keep it online.\n\n\n#### Setup procedure for Ubuntu 20.04 LTS. This will also work for all Debian/Ubuntu based distros. Procedures for other distros maybe slightly different but follows almost the same flow.\n```bash\n# Clone the repository or download as zip and cd into the root folder (Department-Website)\n\n# Update and upgrade apt\n$ sudo apt update \u0026\u0026 sudo apt upgrade -y\n\n# If pip is not installed\n$ sudo apt-get install python3-pip -y\n\n# Remove virtualenv and let poetry install the required version\n$ sudo apt-get remove virtualenv -y \u0026\u0026 sudo python3 -m pip uninstall virtualenv -y\n\n# Clone the repository and cd into the folder\n$ git clone https://github.com/Ryuga/Department-Website.git \u0026\u0026 cd Department-Website\n\n# Install poetry\n$ sudo python3 -m pip install poetry\n\n# Install dependencies from poetry\n$ sudo poetry install\n\n$ sudo nano .env\n# add the following environment variables\n\nDATABASE_URL = your_database_url\n\nDEBUG = False\nLOCAL_DEVELOPMENT = False\nSECRET_KEY = \"your_secret_key\"\nDASHBOARD_URL = \"your_dashboard_url\"\nENCRYPTION_SALT = \"your_encryption_salt\"\nENCRYPTION_ITERATION = your_encryption_iteration_count\n\nPAYTM_MERCHANT_ID = \"your_merchant_id\"\nPAYTM_MERCHANT_KEY = \"your_merchant_key\"\n\nGOOGLE_CLIENT_ID = \"your_client_id\"\nGOOGLE_CLIENT_SECRET = \"your_client_secret\"\n\nPAYTM_PROCESS_TRANSACTION_URL = \"https://securegw.paytm.in/theia/processTransaction\"\n\n# Run collectstatic to collect static files to assets folder for production\n$ sudo poetry run python3 manage.py collectstatic\n\n# install supervisord\n$ sudo apt install supervisor -y\n\n# install nginx\n$ sudo apt install nginx -y\n```\nAt this point, nginx should be running. \n\nIf inbound connections are enabled for port 80, you'll be able to visit the ip with a browser which should give you the default NGINX landing page.\n\n#### Supervisord configurations\nadd the below config inside `/etc/supervisor/conf.d/gunicorn.conf`\n```shell\n[program:gunicorn]\ndirectory=/home/ubuntu/Department-Website\ncommand=poetry run python3 -m gunicorn --workers 3 --bind unix:/home/ubuntu/Department-Website/app.sock core.wsgi:application\nautostart=true\nautorestart=true\nstderr_logfile=/var/log/gunicorn/gunicorn.err.log\nstdout_logfile=/var/log/gunicorn/gunicorn.out.log\n\n[group:guni]\nprograms:gunicorn\n```\n\nMake log and output files for supervisor\n```bash\n$ sudo mkdir /var/log/gunicorn \u0026\u0026 cd /var/log/gunicorn\n\n$ sudo touch gunicorn.out.log\n$ sudo touch gunicorn.err.log\n```\nUpdate supervisor to propagate changes\n\n```bash\n# Reread supervisor configurations\n$ sudo supervisorctl reread\n\n# Update supervisor configurations\n$ sudo supervisorctl update\n\n# Check if supervisor is correctly configured. \n$ sudo supervisorctl status\n# If correctly configured the application should be running with pid and shows uptime. \n# Otherwise check the configurations or logs and try again.\n\n# In case if supervisor status shows restarting, \n# 1) Check if gunicorn is installed \n# 2) check if the log and output files exist for supervisor\n# 3) check the logs and check the Django application\n\n# In case if supervisor status shows exited quickly\n# 1) check if the directory and commands in the gunicorn.conf is correct\n# 2) check the application, the environment variables, database.\n```\n\n#### NGINX Configurations\n\nadd the below config inside `/etc/nginx/sites-available/django.conf`\n\n```shell\nserver {\n        listen 80;\n#        listen 443 ssl http2;\n#        listen [::]:443 ssl http2;\n#        ssl on;\n#        ssl_certificate         /etc/ssl/certs/cert.pem;\n#        ssl_certificate_key     /etc/ssl/private/key.pem;\n#        ssl_client_certificate /etc/ssl/certs/cloudflare.crt;\n#        ssl_verify_client on;\n\n        server_name \u003cip_address_or_domain_here\u003e;\n\n        location / {\n                include proxy_params;\n                proxy_pass http://unix:/home/ubuntu/Department-Website/app.sock;\n        }\n        location /static/ {\n                autoindex on;\n                alias /home/ubuntu/Department-Website/assets/;\n        }   \n        location /protected/media/ {\n                internal;\n                alias /home/ubuntu/Department-Website/media/;\n        }\n    \n}\n```\nOnce added, test if the configurations are okay and symlink with `sites-enabled`\n\n```bash\n$ sudo nginx -t\n# If configurations are not okay, Check the nginx configuration again to see if paths added are correct\n\n# If configurations shows okay, Symlink with sites-enabled\n$ sudo ln  /etc/nginx/sites-available/django.conf /etc/nginx/sites-enabled\n\n# Test nginx again\n$ sudo nginx -t\n\n# If configuration shows okay, Reload nginx\n$ sudo systemctl reload nginx\n\n# Reload supervisor\n$ sudo systemctl reload supervisor\n```\n\n#### Once all the above setups are complete, we'll be able to visit the site in the domain/ip provided in the nginx configuration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryuga%2Fdepartment-website","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryuga%2Fdepartment-website","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryuga%2Fdepartment-website/lists"}