{"id":23705585,"url":"https://github.com/ksh168/django_blog","last_synced_at":"2026-04-18T02:32:33.588Z","repository":{"id":168756766,"uuid":"349917256","full_name":"ksh168/django_blog","owner":"ksh168","description":"Blog website made using Django and deployed on PythonAnywhere. Uses sqlite3 as database","archived":false,"fork":false,"pushed_at":"2021-04-02T06:35:33.000Z","size":1515,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-14T11:07:12.117Z","etag":null,"topics":["django","pillow","python","pythonanywhere","sqlite"],"latest_commit_sha":null,"homepage":"https://djangoblog0.pythonanywhere.com/","language":"Python","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/ksh168.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,"zenodo":null}},"created_at":"2021-03-21T06:26:40.000Z","updated_at":"2021-04-02T06:35:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddb2066a-68c9-4439-8254-e24b4806fcce","html_url":"https://github.com/ksh168/django_blog","commit_stats":null,"previous_names":["ksh168/django_blog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ksh168/django_blog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksh168%2Fdjango_blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksh168%2Fdjango_blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksh168%2Fdjango_blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksh168%2Fdjango_blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksh168","download_url":"https://codeload.github.com/ksh168/django_blog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksh168%2Fdjango_blog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["django","pillow","python","pythonanywhere","sqlite"],"created_at":"2024-12-30T14:47:13.457Z","updated_at":"2026-04-18T02:32:33.566Z","avatar_url":"https://github.com/ksh168.png","language":"Python","readme":"# Django Blog\n\n### This project can be viewed [here](https://djangoblog0.pythonanywhere.com/)\n\n![](django_blog.png)\n\n\n* Blog website made using **Django** and deployed on **PythonAnywhere**. Uses **sqlite3** as database\n\n* Profile images are compressed using [**Pillow**](https://pypi.org/project/Pillow/) before saving to db\n\n* Website is HTTPS secured\n\n### Features:\n\nUsers can:-\n\n:white_check_mark: Register new account, login to existing one\n\n:white_check_mark: Create, update, delete posts\n\n:white_check_mark: Request password reset email\n\n:white_check_mark: Change account username, email, password\n\n:white_check_mark: Choose a custom profile picture\n\n:white_check_mark: View posts by individual user\n\n\n\n### Setup:\n\nAlways recommended to create a virtual environment\n\n* Create a virtual environment named myenv\n```python3 -m venv ./myenv```\n\n* Activate it\n```source myenv/bin/activate```\n\n* Enter the virtual environment and then\n```pip install -r requirements.txt```\n\n## To run server\n\n```python manage.py runserver```\n\n## To make migrations\n\n```python manage.py makemigrations```\n\n## To see equivalent sql command for creating a migrations\n\n```python manage.py sqlmigrate blog 0001```\n\n## To launch shell\n\n```python manage.py shell```\n\n```from django.contrib.auth.models import User```\n\n* To see all users\n\n```User.objects.all()```\n\n* To see first/last user\n\n```User.objects.first() or .last()```\n\n* To filter by username\n\n```User.objects.filter(username='testuser')```\n\n* for first result\n\n```User.objects.filter(username='testuser').first()```\n\n* To get info about a user\n\n```user = User.objects.filter(username='testuser').first()```\n\n- to get user id\n```user.id```\n\n- to get primary key for user(here same as id)\n```user.pk```\n\n* To get user using id\n\n```User.objects.get(id=1)```\n\n* To see all posts\n\n```Post.objects.all()```\n\n* To create a new post\n```post_1=Post(title='Blog 1', content='First post!', author=user)```\n\n* To save the post to our db\n```post_1.save()```\n\n* Save it to a variable post\n```post = Post.objects.first()```\n\n* Now to see it's content\n```post.content```\n\n* To see date_posted\n```post.date_posted```\n\n* To see post author\n```post.author```\n\n* To see post author email\n```post.author.email```\n\n* To see all posts by a user\n```user.post_set```\n```user.post_set.all()```\n\n* To create a new post for a user\n```user.post_set.create(title='Blog 3', content='Third Post')```\n\n## To create users app\n```python manage.py startapp users```\n\n\n### Acknowledgments:\n\nInspired by [Corey M Schafer's](https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g) Django [Tutorial](https://www.youtube.com/playlist?list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksh168%2Fdjango_blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksh168%2Fdjango_blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksh168%2Fdjango_blog/lists"}