{"id":18524822,"url":"https://github.com/suhailvs/stackschools","last_synced_at":"2025-08-14T18:48:03.530Z","repository":{"id":150251739,"uuid":"453599231","full_name":"suhailvs/stackschools","owner":"suhailvs","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-29T12:05:20.000Z","size":2009,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T13:25:41.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://stackschools.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suhailvs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-01-30T05:50:15.000Z","updated_at":"2024-10-29T12:05:23.000Z","dependencies_parsed_at":"2024-11-06T17:47:39.055Z","dependency_job_id":null,"html_url":"https://github.com/suhailvs/stackschools","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhailvs%2Fstackschools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhailvs%2Fstackschools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhailvs%2Fstackschools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhailvs%2Fstackschools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhailvs","download_url":"https://codeload.github.com/suhailvs/stackschools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248040104,"owners_count":21037815,"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":[],"created_at":"2024-11-06T17:43:24.383Z","updated_at":"2025-08-14T18:48:03.498Z","avatar_url":"https://github.com/suhailvs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stack Schools\n\n[![Python Version](https://img.shields.io/badge/python-3.8-brightgreen.svg)](https://python.org)\n[![Django Version](https://img.shields.io/badge/django-3.1-brightgreen.svg)](https://djangoproject.com)\n[![CircleCI](https://circleci.com/gh/suhailvs/django-schools.svg?style=svg)](https://circleci.com/gh/suhailvs/django-schools)\n\n## Running the Project Locally\n\nFirst, clone the repository to your local machine:\n\n```bash\ngit clone https://github.com/suhailvs/stackschools\n```\n\nCreate Virtual Env and Install the requirements:\n\n```bash\ncd stackschools\npython3 -m venv env\nsource ./env/bin/activate\npip install -r requirements.txt\n```\n\n## Deployment\n\nInstall Apache:\n\n\t$ apt-get update\n\t$ apt-get install python3-pip apache2 libapache2-mod-wsgi-py3\n\n+ Change dir: `$ cd /var/www/`\n+ Clone the repo: `$ git clone https://github.com/suhailvs/stackschools`\n+ Change dir: `$ cd stackschools`\n\nCreate virtual and install django:\n\n\t$ python3 -m venv env\n\t$ source ./env/bin/activate\n\t$ apt install libpq-dev\n\t$ apt install gdal-bin\n\t$ apt install postgis\n\t$ pip install -r requirements.txt\n\t$ mkdir media\n\t$ chown www-data:www-data media\n\t$ cp .env.sample .env # update it\n\t$ ./manage.py collectstatic\n\n\nEdit apache config :\n\n\nDjango conf:\n\n\t$ vim /etc/apache2/sites-available/stackschools.conf\n\n\t\u003cVirtualHost *:80\u003e\n\t\tServerName stackschools.com\n\t\tServerAlias www.stackschools.com\n\n\t\tAliasMatch ^/sitemap-(.*) /var/www/stackschools/sitemaps/sitemap-$1\n\t\tAlias /sitemap.xml /var/www/stackschools/sitemaps/sitemap.xml\n\t\tAlias /robots.txt /var/www/stackschools/staticfiles/robots.txt\n\t\tAlias /ads.txt /var/www/stackschools/ads.txt\n\t\tAlias /favicon.ico /var/www/stackschools/staticfiles/favicon.ico\n\t\tAlias /media/ /var/www/stackschools/media/\n\t\tAlias /static/ /var/www/stackschools/staticfiles/\n\t\t\n\t\t\u003cDirectory /var/www/stackschools/staticfiles\u003e\n\t\tRequire all granted\n\t\t\u003c/Directory\u003e\n\t\t\u003cDirectory /var/www/stackschools/media\u003e\n\t\tRequire all granted\n\t\t\u003c/Directory\u003e\n\t\t\n\t\tWSGIDaemonProcess stackschoolapp python-home=/var/www/stackschools/env python-path=/var/www/stackschools/\n\t\tWSGIProcessGroup stackschoolapp\n\t\tWSGIScriptAlias / /var/www/stackschools/mysite/wsgi.py\n\t\t# ErrorLog /var/www/stackschools/media/error.log\n\t\t# CustomLog /var/www/stackschools/media/access.log combined\n\t\u003c/VirtualHost\u003e\n\n\n**lets encrypt for HTTPS**\n\n\nI had to comment the `WSGIDaemonProcess` line out before running letsencrypt.\n\n\t$ vim /etc/apache2/sites-available/stackschools.conf\n\t\u003cVirtualHost *:80\u003e\n\t\t...\n\t\t# WSGIDaemonProcess stackschoolapp python-home=/var/www/stackschools/env python-path=/var/www/stackschools/\n\ninstall certbot and run it.\n\n\tapt-get install python3-certbot-apache\n\ta2ensite stackschools.conf\n\tservice apache2 restart\n\tcertbot --apache -d stackschools.com -d www.stackschools.com\n\nThen uncommented `WSGIDaemonProcess` in `stackshools.conf` and `stackschools-le-ssl.conf` and in `stackschools-le-ssl.conf` change `stackschoolapp` to `stackschoolappssl`.\n\n\nrestart apache: \n\n\t$ a2ensite stackschools.conf\n\t$ service apache2 reload\n\n## Create the database:\n\n#### You might need to install postgresql:\n\n```bash\nsudo apt-get update\nsudo apt-get install postgresql postgresql-contrib\nsudo -u postgres psql\n\nALTER USER postgres WITH PASSWORD 'root';\ncreate database stackschools;\n```\n\n\n**migrate:**\n\n    ./manage.py migrate\n\n\n**Load School Database**\n\nsee https://github.com/suhailvs/stackschools_datas\n\n\n#### Create and upload sitemaps\n\n**update django core sitemap**\n\nsince urls in `sitemap.xml` will look like `sitemap-college.xml?p=3` so need to change it to `sitemap-college3.xml`, to fix edit django file `env/lib/python3.12/site-packages/django/contrib/sitemaps/views.py` line 85 with::\n\n\tSitemapIndexItem(absolute_url.replace('.xml',f'{page}.xml'), site_lastmod)\n\n**update mysite/urls.py**\n\nuncomment sitempas in `mysite/urls.py`::\n\n\tpath('sitemap.xml', sitemaps_views.index, {'sitemaps': my_sitemaps},\n         name='django.contrib.sitemaps.views.index'),\n    path('sitemap-\u003csection\u003e.xml', sitemaps_views.sitemap, {'sitemaps': my_sitemaps},\n         name='django.contrib.sitemaps.views.sitemap'),\n     \n**generate sitemap**\n\n\t./manage.py generate_sitemap\n\nzip `sitemaps` folder inside `media`, then copy it to `github.com/sta-k/stackschools_datas`. then commit and push\n\n**upload sitemaps to server**\n\npull the changes in stackschools_datas and move folder `sitemaps` to `/var/www/stackschools/`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhailvs%2Fstackschools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhailvs%2Fstackschools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhailvs%2Fstackschools/lists"}