Skip to content

Commit 22416ff

Browse files
Add blog details (#48)
* upload my django project * Add the wagtail project * Updating the README.md * Add the medium blog * Remove large files * Update .gitignore --------- Co-authored-by: Thibaud Colas <[email protected]>
1 parent f816206 commit 22416ff

File tree

108 files changed

+1803
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1803
-4
lines changed

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
/wagtail.egg-info/
99
/docs/_build/
1010
/.tox/
11-
/.venv
12-
/venv
11+
.venv
12+
venv
13+
env
14+
*.sqlite3
1315
node_modules
1416
npm-debug.log*
1517
*.idea/

2023/amey-shinde/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Here is a link to my Spotify channel : https://open.spotify.com/artist/4qalTgFtF
1616
| Portfolio Website | https://pistonamey.github.io |
1717
| Twitter | https://twitter.com/ameys2525 |
1818
| LinkedIn | https://linkedin.com/in/amey-shinde-cs |
19+
| Medium Blog (checklist requirement) | https://medium.com/@ameyshinde11111/learning-to-manipulate-audio-wow-872b76b53e78 |
20+
1921

2022
## Tasks:
2123
#### Checklist: Google Summer of Code
@@ -43,7 +45,7 @@ This checklist helps you demonstrate your understanding of how people use GitHub
4345
- [x] Now make another pull request to your own README file, adding a Markdown table with links to:
4446
- [x] Your GitHub profile
4547
- [x] Your Twitter profile if any
46-
- [x] Your Mastodown profile if any
48+
- [ ] Your Mastodown profile if any
4749
- [x] Your LinkedIn profile if any
4850
- [x] Your personal website
4951
- [x] Update your pull request to add a new `## Tasks` section to your participant file, and copy-paste our contributor guide’s checklists into it, marking each item as completed or not according to your progress.
@@ -61,7 +63,7 @@ With this checklist, we expect you to demonstrate an ability to do research and
6163

6264
- [x] Create a new `## Research` section in your personal file, with a list of links to the resources you’ve found most useful so far in trying to understand Wagtail as a project and the specific GSoC project idea you’re interested in.
6365
- [x] Go through our projects under the [wagtail organisation](https://github.com/wagtail) in GitHub. Create a new list with links to repositories or specific issues you would be interested in contributing to during the internship.
64-
- [ ] Write a short blog post describing things you’ve learned recently, and share it with us. The post must be in English, include at least one image, be less than 500 words, and score a Grade 6 or lower on <https://hemingwayapp.com/>. The post has to be posted on a publicly-available platform (Dev.to, Hashnode, Medium, your own website), and you must also add it as a new section in your personal file in this repository (so we can provide feedback on the contents).
66+
- [x] Write a short blog post describing things you’ve learned recently, and share it with us. The post must be in English, include at least one image, be less than 500 words, and score a Grade 6 or lower on <https://hemingwayapp.com/>. The post has to be posted on a publicly-available platform (Dev.to, Hashnode, Medium, your own website), and you must also add it as a new section in your personal file in this repository (so we can provide feedback on the contents).
6567

6668
### Checklist: Django and Wagtail
6769

2023/amey-shinde/mysite/db.sqlite3

140 KB
Binary file not shown.

2023/amey-shinde/mysite/manage.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
3+
import os
4+
import sys
5+
6+
7+
def main():
8+
"""Run administrative tasks."""
9+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
19+
20+
21+
if __name__ == '__main__':
22+
main()

2023/amey-shinde/mysite/mysite/__init__.py

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for mysite project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/dev/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
15+
16+
application = get_asgi_application()
+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
"""
2+
Django settings for mysite project.
3+
4+
Generated by 'django-admin startproject' using Django 5.0.dev20230318130541.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/dev/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/dev/ref/settings/
11+
"""
12+
13+
from pathlib import Path
14+
15+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
16+
BASE_DIR = Path(__file__).resolve().parent.parent
17+
18+
19+
# Quick-start development settings - unsuitable for production
20+
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
21+
22+
# SECURITY WARNING: keep the secret key used in production secret!
23+
SECRET_KEY = 'django-insecure-=cn^m=(s5wz=5b-=p1t(sf&parbuep9kif=iv0gwnz7yav$x#^'
24+
25+
# SECURITY WARNING: don't run with debug turned on in production!
26+
DEBUG = True
27+
28+
ALLOWED_HOSTS = []
29+
30+
31+
# Application definition
32+
33+
INSTALLED_APPS = [
34+
'polls.apps.PollsConfig',
35+
'django.contrib.admin',
36+
'django.contrib.auth',
37+
'django.contrib.contenttypes',
38+
'django.contrib.sessions',
39+
'django.contrib.messages',
40+
'django.contrib.staticfiles',
41+
]
42+
43+
MIDDLEWARE = [
44+
'django.middleware.security.SecurityMiddleware',
45+
'django.contrib.sessions.middleware.SessionMiddleware',
46+
'django.middleware.common.CommonMiddleware',
47+
'django.middleware.csrf.CsrfViewMiddleware',
48+
'django.contrib.auth.middleware.AuthenticationMiddleware',
49+
'django.contrib.messages.middleware.MessageMiddleware',
50+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
51+
]
52+
53+
ROOT_URLCONF = 'mysite.urls'
54+
55+
TEMPLATES = [
56+
{
57+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
58+
'DIRS': [BASE_DIR / 'templates'],
59+
'APP_DIRS': True,
60+
'OPTIONS': {
61+
'context_processors': [
62+
'django.template.context_processors.debug',
63+
'django.template.context_processors.request',
64+
'django.contrib.auth.context_processors.auth',
65+
'django.contrib.messages.context_processors.messages',
66+
],
67+
},
68+
},
69+
]
70+
71+
WSGI_APPLICATION = 'mysite.wsgi.application'
72+
73+
74+
# Database
75+
# https://docs.djangoproject.com/en/dev/ref/settings/#databases
76+
77+
DATABASES = {
78+
'default': {
79+
'ENGINE': 'django.db.backends.sqlite3',
80+
'NAME': BASE_DIR / 'db.sqlite3',
81+
}
82+
}
83+
84+
85+
# Password validation
86+
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators
87+
88+
AUTH_PASSWORD_VALIDATORS = [
89+
{
90+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
91+
},
92+
{
93+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
94+
},
95+
{
96+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
97+
},
98+
{
99+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
100+
},
101+
]
102+
103+
104+
# Internationalization
105+
# https://docs.djangoproject.com/en/dev/topics/i18n/
106+
107+
LANGUAGE_CODE = 'en-us'
108+
109+
TIME_ZONE = 'America/Chicago'
110+
111+
USE_I18N = True
112+
113+
USE_TZ = True
114+
115+
116+
# Static files (CSS, JavaScript, Images)
117+
# https://docs.djangoproject.com/en/dev/howto/static-files/
118+
119+
STATIC_URL = 'static/'
120+
121+
# Default primary key field type
122+
# https://docs.djangoproject.com/en/dev/ref/settings/#default-auto-field
123+
124+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
URL configuration for mysite project.
3+
4+
The `urlpatterns` list routes URLs to views. For more information please see:
5+
https://docs.djangoproject.com/en/dev/topics/http/urls/
6+
Examples:
7+
Function views
8+
1. Add an import: from my_app import views
9+
2. Add a URL to urlpatterns: path('', views.home, name='home')
10+
Class-based views
11+
1. Add an import: from other_app.views import Home
12+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13+
Including another URLconf
14+
1. Import the include() function: from django.urls import include, path
15+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16+
"""
17+
from django.contrib import admin
18+
from django.urls import path,include
19+
20+
urlpatterns = [
21+
path('polls/',include('polls.urls')),
22+
path('admin/', admin.site.urls),
23+
]
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for mysite project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
15+
16+
application = get_wsgi_application()

2023/amey-shinde/mysite/polls/__init__.py

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from django.contrib import admin
2+
3+
from .models import Choice, Question
4+
5+
6+
class ChoiceInline(admin.TabularInline):
7+
model = Choice
8+
extra = 3
9+
10+
11+
class QuestionAdmin(admin.ModelAdmin):
12+
fieldsets = [
13+
(None, {'fields': ['question_text']}),
14+
('Date information', {'fields': ['pub_date']}),
15+
]
16+
inlines = [ChoiceInline]
17+
list_display = ('question_text', 'pub_date', 'was_published_recently')
18+
list_filter = ['pub_date']
19+
search_fields = ['question_text']
20+
21+
22+
admin.site.register(Question, QuestionAdmin)

2023/amey-shinde/mysite/polls/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class PollsConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'polls'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Generated by Django 5.0.dev20230318130541 on 2023-03-19 14:46
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
initial = True
10+
11+
dependencies = [
12+
]
13+
14+
operations = [
15+
migrations.CreateModel(
16+
name='Question',
17+
fields=[
18+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
19+
('question_text', models.CharField(max_length=200)),
20+
('pub_date', models.DateTimeField(verbose_name='date published')),
21+
],
22+
),
23+
migrations.CreateModel(
24+
name='Choice',
25+
fields=[
26+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
27+
('choice_text', models.CharField(max_length=200)),
28+
('votes', models.IntegerField(default=0)),
29+
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.question')),
30+
],
31+
),
32+
]

2023/amey-shinde/mysite/polls/migrations/__init__.py

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from django.db import models
2+
from django.utils import timezone
3+
from django.contrib import admin
4+
import datetime
5+
6+
7+
class Question(models.Model):
8+
question_text = models.CharField(max_length=200)
9+
pub_date = models.DateTimeField('date published')
10+
11+
def __str__(self):
12+
return self.question_text
13+
14+
@admin.display(
15+
boolean=True,
16+
ordering='pub_date',
17+
description='Published recently?',
18+
)
19+
def was_published_recently(self):
20+
now = timezone.now()
21+
return now - datetime.timedelta(days=1) <= self.pub_date <= now
22+
23+
24+
class Choice(models.Model):
25+
question = models.ForeignKey(Question, on_delete=models.CASCADE)
26+
choice_text = models.CharField(max_length=200)
27+
votes = models.IntegerField(default=0)
28+
29+
def __str__(self):
30+
return self.choice_text
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
li a {
2+
color: green;
3+
}
4+
5+
body {
6+
background: white url("images/background.png") no-repeat;
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% extends "admin/base.html" %}
2+
3+
{% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
4+
5+
{% block branding %}
6+
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
7+
{% if user.is_anonymous %}
8+
{% include "admin/color_theme_toggle.html" %}
9+
{% endif %}
10+
{% endblock %}
11+
12+
{% block nav-global %}{% endblock %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<form action="{% url 'polls:vote' question.id %}" method="post">
2+
{% csrf_token %}
3+
<fieldset>
4+
<legend>
5+
<h1>{{ question.question_text }}</h1>
6+
</legend>
7+
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
8+
{% for choice in question.choice_set.all %}
9+
<input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}">
10+
<label for="choice{{ forloop.counter }}">{{ choice.choice_text }}</label><br>
11+
{% endfor %}
12+
</fieldset>
13+
<input type="submit" value="Vote">
14+
</form>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% load static %}
2+
3+
<link rel="stylesheet" href="{% static 'polls/style.css' %}">
4+
5+
{% if latest_question_list %}
6+
<ul>
7+
{% for question in latest_question_list %}
8+
<li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a></li>
9+
{% endfor %}
10+
</ul>
11+
{% else %}
12+
<p>No polls are available.</p>
13+
{% endif %}

0 commit comments

Comments
 (0)