├── floodrelief
├── __init__.py
├── wsgi.py
├── urls.py
└── settings.py
├── mainapp
├── __init__.py
├── migrations
│ ├── __init__.py
│ ├── 0013_auto_20180812_1547.py
│ ├── 0015_auto_20180812_1615.py
│ ├── 0007_auto_20180811_1019.py
│ ├── 0004_auto_20180811_0952.py
│ ├── 0018_auto_20180813_1330.py
│ ├── 0003_auto_20180811_0946.py
│ ├── 0005_auto_20180811_0957.py
│ ├── 0016_contributor_status.py
│ ├── 0002_request_dateadded.py
│ ├── 0022_volunteer_joined.py
│ ├── 0017_auto_20180813_1327.py
│ ├── 0020_auto_20180815_1145.py
│ ├── 0010_auto_20180811_1235.py
│ ├── 0009_auto_20180811_1146.py
│ ├── 0019_districtcollection.py
│ ├── 0012_contributors.py
│ ├── 0021_auto_20180815_1153.py
│ ├── 0006_volunteer.py
│ ├── 0014_auto_20180812_1613.py
│ ├── 0008_auto_20180811_1127.py
│ ├── 0001_initial.py
│ └── 0011_auto_20180811_1455.py
├── tests.py
├── apps.py
├── templates
│ └── mainapp
│ │ ├── req_success.html
│ │ ├── contrib_success.html
│ │ ├── reg_success.html
│ │ ├── volunteer_form.html
│ │ ├── district_needs.html
│ │ ├── contributor_form.html
│ │ ├── districtmanager_list.html
│ │ ├── request_list.html
│ │ └── request_form.html
├── admin.py
├── urls.py
├── views.py
└── models.py
├── Procfile
├── file.sqlite
├── .gitignore
├── static
├── images
│ ├── emblem.png
│ ├── msg_cm.jpg
│ ├── ieeelogo.png
│ ├── it-mission.png
│ ├── kerala-government.jpg
│ └── kerala-government.png
├── fonts
│ ├── raleway-medium-webfont.woff
│ ├── raleway-medium-webfont.woff2
│ ├── raleway-regular-webfont.woff
│ ├── raleway-regular-webfont.woff2
│ └── fonts.css
└── css
│ └── style.css
├── README.md
├── requirements.txt
├── manage.py
└── templates
├── base.html
└── home.html
/floodrelief/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/mainapp/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/mainapp/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: gunicorn floodrelief.wsgi
2 |
--------------------------------------------------------------------------------
/file.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/file.sqlite
--------------------------------------------------------------------------------
/mainapp/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | *.py~
3 | __pycache__
4 | db.sqlite3
5 | .env
6 | staticfiles/
7 | mysite.log
8 |
--------------------------------------------------------------------------------
/static/images/emblem.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/static/images/emblem.png
--------------------------------------------------------------------------------
/static/images/msg_cm.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/static/images/msg_cm.jpg
--------------------------------------------------------------------------------
/static/images/ieeelogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/static/images/ieeelogo.png
--------------------------------------------------------------------------------
/static/images/it-mission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/static/images/it-mission.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Send PRs and issues to https://github.com/IEEEKeralaSection/rescuekerala/
2 | Recreate your issues pls
3 |
--------------------------------------------------------------------------------
/mainapp/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class MainappConfig(AppConfig):
5 | name = 'mainapp'
6 |
--------------------------------------------------------------------------------
/static/images/kerala-government.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/static/images/kerala-government.jpg
--------------------------------------------------------------------------------
/static/fonts/raleway-medium-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/static/fonts/raleway-medium-webfont.woff
--------------------------------------------------------------------------------
/static/fonts/raleway-medium-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/static/fonts/raleway-medium-webfont.woff2
--------------------------------------------------------------------------------
/static/fonts/raleway-regular-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/static/fonts/raleway-regular-webfont.woff
--------------------------------------------------------------------------------
/static/fonts/raleway-regular-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/biswaz/rescuekerala/HEAD/static/fonts/raleway-regular-webfont.woff2
--------------------------------------------------------------------------------
/mainapp/templates/mainapp/req_success.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load bootstrap3 %}
3 |
4 | {% block content %}
5 |
6 |
Request successfully registered
7 |
8 | {% endblock %}
9 |
--------------------------------------------------------------------------------
/mainapp/templates/mainapp/contrib_success.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load bootstrap3 %}
3 |
4 | {% block content %}
5 |
6 | Our volunteer will contact you soon for collection
7 |
8 | {% endblock %}
9 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | dj-database-url==0.5.0
2 | Django==2.1
3 | django-bootstrap3==10.0.1
4 | django-environ==0.4.5
5 | django-filter==2.0.0
6 | gunicorn==19.9.0
7 | psycopg2==2.7.5
8 | pytz==2018.5
9 | whitenoise==4.0
10 |
--------------------------------------------------------------------------------
/mainapp/templates/mainapp/reg_success.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load bootstrap3 %}
3 |
4 | {% block content %}
5 |
6 | You have been registered successfully. Please wait for the call for action.
7 |
8 | {% endblock %}
9 |
--------------------------------------------------------------------------------
/mainapp/templates/mainapp/volunteer_form.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load bootstrap3 %}
3 |
4 | {% block content %}
5 |
6 |
15 |
16 | {% endblock %}
17 |
--------------------------------------------------------------------------------
/mainapp/migrations/0013_auto_20180812_1547.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-12 10:17
2 |
3 | from django.db import migrations
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0012_contributors'),
10 | ]
11 |
12 | operations = [
13 | migrations.RenameModel(
14 | old_name='Contributors',
15 | new_name='Contributor',
16 | ),
17 | ]
18 |
--------------------------------------------------------------------------------
/mainapp/migrations/0015_auto_20180812_1615.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-12 10:45
2 |
3 | from django.db import migrations
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0014_auto_20180812_1613'),
10 | ]
11 |
12 | operations = [
13 | migrations.RenameModel(
14 | old_name='DistrictNeeds',
15 | new_name='DistrictNeed',
16 | ),
17 | ]
18 |
--------------------------------------------------------------------------------
/floodrelief/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for floodrelief 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/2.1/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', 'floodrelief.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/mainapp/migrations/0007_auto_20180811_1019.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 10:19
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0006_volunteer'),
10 | ]
11 |
12 | operations = [
13 | migrations.AlterField(
14 | model_name='volunteer',
15 | name='address',
16 | field=models.TextField(),
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/mainapp/migrations/0004_auto_20180811_0952.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 09:52
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0003_auto_20180811_0946'),
10 | ]
11 |
12 | operations = [
13 | migrations.AlterField(
14 | model_name='request',
15 | name='status',
16 | field=models.BooleanField(default=False),
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/mainapp/migrations/0018_auto_20180813_1330.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-13 08:00
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0017_auto_20180813_1327'),
10 | ]
11 |
12 | operations = [
13 | migrations.AlterField(
14 | model_name='districtneed',
15 | name='needs',
16 | field=models.TextField(verbose_name='Items required'),
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/static/fonts/fonts.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Raleway';
3 | src: url('raleway-medium-webfont.woff2') format('woff2'),
4 | url('raleway-medium-webfont.woff') format('woff');
5 | font-weight: 500;
6 | font-style: normal;
7 | }
8 |
9 |
10 |
11 |
12 | @font-face {
13 | font-family: 'Raleway';
14 | src: url('raleway-regular-webfont.woff2') format('woff2'),
15 | url('raleway-regular-webfont.woff') format('woff');
16 | font-weight: normal;
17 | font-style: normal;
18 | }
19 |
--------------------------------------------------------------------------------
/mainapp/migrations/0003_auto_20180811_0946.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 09:46
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0002_request_dateadded'),
10 | ]
11 |
12 | operations = [
13 | migrations.AlterField(
14 | model_name='request',
15 | name='needothers',
16 | field=models.CharField(max_length=500, verbose_name='Other needs'),
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/mainapp/migrations/0005_auto_20180811_0957.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 09:57
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0004_auto_20180811_0952'),
10 | ]
11 |
12 | operations = [
13 | migrations.AlterField(
14 | model_name='request',
15 | name='needothers',
16 | field=models.CharField(blank=True, max_length=500, verbose_name='Other needs'),
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/mainapp/migrations/0016_contributor_status.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-12 11:18
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0015_auto_20180812_1615'),
10 | ]
11 |
12 | operations = [
13 | migrations.AddField(
14 | model_name='contributor',
15 | name='status',
16 | field=models.CharField(choices=[('new', 'New'), ('ful', 'Fullfilled')], default='new', max_length=10),
17 | ),
18 | ]
19 |
--------------------------------------------------------------------------------
/mainapp/migrations/0002_request_dateadded.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 09:32
2 |
3 | from django.db import migrations, models
4 | import django.utils.timezone
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('mainapp', '0001_initial'),
11 | ]
12 |
13 | operations = [
14 | migrations.AddField(
15 | model_name='request',
16 | name='dateadded',
17 | field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
18 | preserve_default=False,
19 | ),
20 | ]
21 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | import sys
4 |
5 | if __name__ == '__main__':
6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'floodrelief.settings')
7 | try:
8 | from django.core.management import execute_from_command_line
9 | except ImportError as exc:
10 | raise ImportError(
11 | "Couldn't import Django. Are you sure it's installed and "
12 | "available on your PYTHONPATH environment variable? Did you "
13 | "forget to activate a virtual environment?"
14 | ) from exc
15 | execute_from_command_line(sys.argv)
16 |
--------------------------------------------------------------------------------
/mainapp/migrations/0022_volunteer_joined.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-15 08:55
2 |
3 | from django.db import migrations, models
4 | import django.utils.timezone
5 |
6 |
7 | class Migration(migrations.Migration):
8 |
9 | dependencies = [
10 | ('mainapp', '0021_auto_20180815_1153'),
11 | ]
12 |
13 | operations = [
14 | migrations.AddField(
15 | model_name='volunteer',
16 | name='joined',
17 | field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
18 | preserve_default=False,
19 | ),
20 | ]
21 |
--------------------------------------------------------------------------------
/mainapp/templates/mainapp/district_needs.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load bootstrap3 %}
3 |
4 | {% block content %}
5 |
6 |
7 |
8 | District
9 | Items required
10 | Contacts & Collection points
11 |
12 | {% for item in district_data %}
13 |
14 |
15 | {{item.get_district_display}}
16 |
17 | {{item.needs|linebreaks}}
18 |
19 |
20 | {{item.cnandpts|linebreaks}}
21 |
22 |
23 | {% endfor %}
24 |
25 | {% endblock %}
26 |
--------------------------------------------------------------------------------
/mainapp/migrations/0017_auto_20180813_1327.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-13 07:57
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0016_contributor_status'),
10 | ]
11 |
12 | operations = [
13 | migrations.RemoveField(
14 | model_name='districtneed',
15 | name='status',
16 | ),
17 | migrations.AddField(
18 | model_name='districtneed',
19 | name='cnandpts',
20 | field=models.TextField(default=' ', verbose_name='Contacts and collection points'),
21 | preserve_default=False,
22 | ),
23 | ]
24 |
--------------------------------------------------------------------------------
/mainapp/templates/mainapp/contributor_form.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load bootstrap3 %}
3 |
4 | {% block content %}
5 |
6 |
7 |
23 |
24 | {% endblock %}
25 |
--------------------------------------------------------------------------------
/mainapp/migrations/0020_auto_20180815_1145.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-15 06:15
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0019_districtcollection'),
10 | ]
11 |
12 | operations = [
13 | migrations.AddField(
14 | model_name='volunteer',
15 | name='is_dm',
16 | field=models.BooleanField(default=False, verbose_name='Is district manager'),
17 | ),
18 | migrations.AlterField(
19 | model_name='volunteer',
20 | name='is_spoc',
21 | field=models.BooleanField(default=False, verbose_name='Is point of contact'),
22 | ),
23 | ]
24 |
--------------------------------------------------------------------------------
/mainapp/migrations/0010_auto_20180811_1235.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 12:35
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0009_auto_20180811_1146'),
10 | ]
11 |
12 | operations = [
13 | migrations.AlterField(
14 | model_name='request',
15 | name='status',
16 | field=models.CharField(choices=[('new', 'New'), ('pro', 'In progess'), ('sup', 'Supplied')], default='new', max_length=10),
17 | ),
18 | migrations.AlterField(
19 | model_name='request',
20 | name='supply_details',
21 | field=models.CharField(blank=True, max_length=100),
22 | ),
23 | ]
24 |
--------------------------------------------------------------------------------
/mainapp/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from .models import Request, Volunteer, Contributor, DistrictNeed, DistrictCollection, DistrictManager
3 |
4 |
5 | class RequestAdmin(admin.ModelAdmin):
6 | readonly_fields = ('dateadded',)
7 | ordering = ('district',)
8 | list_filter = ('district', 'status',)
9 |
10 |
11 | class VolunteerAdmin(admin.ModelAdmin):
12 | readonly_fields = ('joined',)
13 | list_display = ('name', 'phone', 'organisation', 'joined')
14 | list_filter = ('district', 'joined',)
15 |
16 | admin.site.register(Request, RequestAdmin)
17 | admin.site.register(Volunteer, VolunteerAdmin)
18 | admin.site.register(Contributor)
19 | admin.site.register(DistrictNeed)
20 | admin.site.register(DistrictCollection)
21 | admin.site.register(DistrictManager)
22 |
--------------------------------------------------------------------------------
/mainapp/migrations/0009_auto_20180811_1146.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 11:46
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0008_auto_20180811_1127'),
10 | ]
11 |
12 | operations = [
13 | migrations.AddField(
14 | model_name='request',
15 | name='needtoilet',
16 | field=models.BooleanField(default=False, verbose_name='Toileteries'),
17 | preserve_default=False,
18 | ),
19 | migrations.AlterField(
20 | model_name='request',
21 | name='status',
22 | field=models.CharField(choices=[('new', 'New'), ('pro', 'In progess'), ('sup', 'Supplied')], max_length=10),
23 | ),
24 | ]
25 |
--------------------------------------------------------------------------------
/mainapp/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 |
3 | from . import views
4 |
5 | urlpatterns = [
6 | path('', views.HomePageView.as_view(), name='home'),
7 | path('request/', views.CreateRequest.as_view(), name='requestview'),
8 | path('volunteer/', views.RegisterVolunteer.as_view(), name='registerview'),
9 | path('requests/', views.request_list, name='requestlistview'),
10 | path('contactus/', views.districtmanager_list, name='contactus'),
11 | path('reg_success/', views.RegSuccess.as_view(), name='reg_successview'),
12 | path('req_sucess/', views.ReqSuccess.as_view(), name='req_sucessview'),
13 | path('district_needs/', views.DistNeeds.as_view(), name='distneedsview'),
14 | path('reg_contrib/', views.RegisterContributor.as_view(), name='reg_contribview'),
15 | path('contrib_success/', views.ContribSuccess.as_view(), name='contribsucessview'),
16 | ]
17 |
--------------------------------------------------------------------------------
/mainapp/templates/mainapp/districtmanager_list.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load bootstrap3 %}
3 |
4 | {% block content %}
5 |
6 |
7 | Volunteers are available across Kerala. Contact the District level point of contacts for any help.
8 | സഹായത്തിനായി വൊളന്റീയര്മാര് തയ്യാറാണ്. സഹായം ആവശ്യമെങ്കില് ഒരോ ജില്ലയിലെയും നിയോഗിക്കപെട്ട ഉദ്യോഗസ്ഥരുമായി ബന്ധപ്പെടാം
9 |
10 |
14 |
15 |
16 | Name
17 | Phone
18 | Email
19 |
20 | {% for req in filter.qs %}
21 |
22 | {{ req.name }}
23 | {{ req.phone }}
24 | {{ req.email }}
25 |
26 | {% endfor %}
27 |
28 | {% endblock %}
29 |
--------------------------------------------------------------------------------
/mainapp/templates/mainapp/request_list.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load bootstrap3 %}
3 |
4 | {% block content %}
5 |
6 |
10 |
11 |
12 |
13 | District
14 | Location
15 | Requestee
16 | Contact number
17 | {# Summary of request #}
18 | Date
19 |
20 | {% for req in filter.qs %}
21 |
22 | {{ req.get_district_display }}
23 | {{ req.location }}
24 | {{ req.requestee }}
25 | {{ req.requestee_phone }}
26 | {# {{ req.requestee_phone }} #}
27 | {{ req.dateadded }}
28 |
29 | {% endfor %}
30 |
31 |
32 | {% endblock %}
33 |
--------------------------------------------------------------------------------
/floodrelief/urls.py:
--------------------------------------------------------------------------------
1 | """floodrelief URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 | from django.contrib import admin
17 | from django.urls import path, include
18 | from django.conf import settings
19 |
20 | admin.site.site_header = settings.ADMIN_SITE_HEADER
21 |
22 | urlpatterns = [
23 | path('', include('mainapp.urls')),
24 | path('admin/', admin.site.urls),
25 | ]
26 |
--------------------------------------------------------------------------------
/mainapp/migrations/0019_districtcollection.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-14 05:25
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0018_auto_20180813_1330'),
10 | ]
11 |
12 | operations = [
13 | migrations.CreateModel(
14 | name='DistrictCollection',
15 | fields=[
16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17 | ('district', models.CharField(choices=[('tvm', 'Thiruvananthapuram'), ('ptm', 'Pathanamthitta'), ('alp', 'Alappuzha'), ('ktm', 'Kottayam'), ('idk', 'Idukki'), ('mpm', 'Malappuram'), ('koz', 'Kozhikode'), ('wnd', 'Wayanad'), ('knr', 'Kannur'), ('ksr', 'Kasaragod'), ('pkd', 'Palakkad'), ('tcr', 'Thrissur'), ('ekm', 'Ernakulam'), ('kol', 'Kollam')], max_length=15)),
18 | ('collection', models.TextField(verbose_name='Details of collected items')),
19 | ],
20 | ),
21 | ]
22 |
--------------------------------------------------------------------------------
/mainapp/migrations/0012_contributors.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-12 10:15
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0011_auto_20180811_1455'),
10 | ]
11 |
12 | operations = [
13 | migrations.CreateModel(
14 | name='Contributors',
15 | fields=[
16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17 | ('district', models.CharField(choices=[('tvm', 'Thiruvananthapuram'), ('ptm', 'Pathanamthitta'), ('alp', 'Alappuzha'), ('ktm', 'Kottayam'), ('idk', 'Idukki'), ('mpm', 'Malappuram'), ('koz', 'Kozhikode'), ('wnd', 'Wayanad'), ('knr', 'Kannur'), ('ksr', 'Kasaragod'), ('pkd', 'Palakkad'), ('tcr', 'Thrissur'), ('ekm', 'Ernakulam'), ('kol', 'Kollam')], max_length=15)),
18 | ('name', models.CharField(max_length=100)),
19 | ('phone', models.CharField(max_length=10)),
20 | ('address', models.TextField()),
21 | ('commodities', models.TextField(verbose_name='What you can contribute')),
22 | ],
23 | ),
24 | ]
25 |
--------------------------------------------------------------------------------
/mainapp/migrations/0021_auto_20180815_1153.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-15 06:23
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0020_auto_20180815_1145'),
10 | ]
11 |
12 | operations = [
13 | migrations.CreateModel(
14 | name='DistrictManager',
15 | fields=[
16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17 | ('district', models.CharField(choices=[('tvm', 'Thiruvananthapuram'), ('ptm', 'Pathanamthitta'), ('alp', 'Alappuzha'), ('ktm', 'Kottayam'), ('idk', 'Idukki'), ('mpm', 'Malappuram'), ('koz', 'Kozhikode'), ('wnd', 'Wayanad'), ('knr', 'Kannur'), ('ksr', 'Kasaragod'), ('pkd', 'Palakkad'), ('tcr', 'Thrissur'), ('ekm', 'Ernakulam'), ('kol', 'Kollam')], max_length=15)),
18 | ('name', models.CharField(max_length=100)),
19 | ('phone', models.CharField(max_length=10)),
20 | ('email', models.CharField(max_length=100)),
21 | ],
22 | ),
23 | migrations.RemoveField(
24 | model_name='volunteer',
25 | name='is_dm',
26 | ),
27 | ]
28 |
--------------------------------------------------------------------------------
/mainapp/migrations/0006_volunteer.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 10:14
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0005_auto_20180811_0957'),
10 | ]
11 |
12 | operations = [
13 | migrations.CreateModel(
14 | name='Volunteer',
15 | fields=[
16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17 | ('district', models.CharField(choices=[('tvm', 'Thiruvananthapuram'), ('ptm', 'Pathanamthitta'), ('alp', 'Alappuzha'), ('ktm', 'Kottayam'), ('idk', 'Idukki'), ('mpm', 'Malappuram'), ('koz', 'Kozhikode'), ('wnd', 'Wayanad'), ('knr', 'Kannur'), ('ksr', 'Kasaragod'), ('pkd', 'Palakkad'), ('tcr', 'Thrissur'), ('ekm', 'Ernakulam'), ('kol', 'Kollam')], max_length=15)),
18 | ('name', models.CharField(max_length=100)),
19 | ('phone', models.CharField(max_length=10)),
20 | ('organisation', models.CharField(max_length=250)),
21 | ('address', models.CharField(max_length=1000)),
22 | ('is_spoc', models.BooleanField(default=False)),
23 | ],
24 | ),
25 | ]
26 |
--------------------------------------------------------------------------------
/mainapp/migrations/0014_auto_20180812_1613.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-12 10:43
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0013_auto_20180812_1547'),
10 | ]
11 |
12 | operations = [
13 | migrations.CreateModel(
14 | name='DistrictNeeds',
15 | fields=[
16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17 | ('district', models.CharField(choices=[('tvm', 'Thiruvananthapuram'), ('ptm', 'Pathanamthitta'), ('alp', 'Alappuzha'), ('ktm', 'Kottayam'), ('idk', 'Idukki'), ('mpm', 'Malappuram'), ('koz', 'Kozhikode'), ('wnd', 'Wayanad'), ('knr', 'Kannur'), ('ksr', 'Kasaragod'), ('pkd', 'Palakkad'), ('tcr', 'Thrissur'), ('ekm', 'Ernakulam'), ('kol', 'Kollam')], max_length=15)),
18 | ('needs', models.TextField()),
19 | ('status', models.TextField()),
20 | ],
21 | ),
22 | migrations.AlterField(
23 | model_name='contributor',
24 | name='commodities',
25 | field=models.TextField(verbose_name='What you can contribute. Eg: Shirts, torches etc'),
26 | ),
27 | ]
28 |
--------------------------------------------------------------------------------
/mainapp/migrations/0008_auto_20180811_1127.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 11:27
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0007_auto_20180811_1019'),
10 | ]
11 |
12 | operations = [
13 | migrations.AddField(
14 | model_name='request',
15 | name='needkit_util',
16 | field=models.BooleanField(default=False, verbose_name='Kitchen utencil'),
17 | preserve_default=False,
18 | ),
19 | migrations.AlterField(
20 | model_name='request',
21 | name='needcloth',
22 | field=models.BooleanField(verbose_name='Clothing'),
23 | ),
24 | migrations.AlterField(
25 | model_name='request',
26 | name='needfood',
27 | field=models.BooleanField(verbose_name='Food'),
28 | ),
29 | migrations.AlterField(
30 | model_name='request',
31 | name='needmed',
32 | field=models.BooleanField(verbose_name='Medicine'),
33 | ),
34 | migrations.AlterField(
35 | model_name='request',
36 | name='needwater',
37 | field=models.BooleanField(verbose_name='Water'),
38 | ),
39 | ]
40 |
--------------------------------------------------------------------------------
/mainapp/templates/mainapp/request_form.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load bootstrap3 %}
3 |
4 | {% block content %}
5 |
14 |
15 |
45 |
46 | {% endblock %}
47 |
--------------------------------------------------------------------------------
/mainapp/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 09:07
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | initial = True
9 |
10 | dependencies = [
11 | ]
12 |
13 | operations = [
14 | migrations.CreateModel(
15 | name='Request',
16 | fields=[
17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18 | ('district', models.CharField(choices=[('tvm', 'Thiruvananthapuram'), ('ptm', 'Pathanamthitta'), ('alp', 'Alappuzha'), ('ktm', 'Kottayam'), ('idk', 'Idukki'), ('mpm', 'Malappuram'), ('koz', 'Kozhikode'), ('wnd', 'Wayanad'), ('knr', 'Kannur'), ('ksr', 'Kasaragod'), ('pkd', 'Palakkad'), ('tcr', 'Thrissur'), ('ekm', 'Ernakulam'), ('kol', 'Kollam')], max_length=15)),
19 | ('location', models.CharField(max_length=500)),
20 | ('requestee', models.CharField(max_length=100)),
21 | ('requestee_phone', models.CharField(max_length=10)),
22 | ('needwater', models.BooleanField()),
23 | ('needfood', models.BooleanField()),
24 | ('needcloth', models.BooleanField()),
25 | ('needmed', models.BooleanField()),
26 | ('needothers', models.CharField(max_length=500)),
27 | ('status', models.BooleanField()),
28 | ('supply_details', models.CharField(max_length=100)),
29 | ],
30 | ),
31 | ]
32 |
--------------------------------------------------------------------------------
/mainapp/migrations/0011_auto_20180811_1455.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 2.1 on 2018-08-11 14:55
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | dependencies = [
9 | ('mainapp', '0010_auto_20180811_1235'),
10 | ]
11 |
12 | operations = [
13 | migrations.AddField(
14 | model_name='request',
15 | name='detailcloth',
16 | field=models.CharField(blank=True, max_length=250, verbose_name='Details for required clothing'),
17 | ),
18 | migrations.AddField(
19 | model_name='request',
20 | name='detailfood',
21 | field=models.CharField(blank=True, max_length=250, verbose_name='Details for required food'),
22 | ),
23 | migrations.AddField(
24 | model_name='request',
25 | name='detailkit_util',
26 | field=models.CharField(blank=True, max_length=250, verbose_name='Details for required kitchen utensil'),
27 | ),
28 | migrations.AddField(
29 | model_name='request',
30 | name='detailmed',
31 | field=models.CharField(blank=True, max_length=250, verbose_name='Details for required medicine'),
32 | ),
33 | migrations.AddField(
34 | model_name='request',
35 | name='detailtoilet',
36 | field=models.CharField(blank=True, max_length=250, verbose_name='Details for required toileteries'),
37 | ),
38 | migrations.AddField(
39 | model_name='request',
40 | name='detailwater',
41 | field=models.CharField(blank=True, max_length=250, verbose_name='Details for required water'),
42 | ),
43 | migrations.AlterField(
44 | model_name='request',
45 | name='needkit_util',
46 | field=models.BooleanField(verbose_name='Kitchen utensil'),
47 | ),
48 | ]
49 |
--------------------------------------------------------------------------------
/templates/base.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 | {% load bootstrap3 %}
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Kerala Rescue
13 |
14 | {# #}
15 |
16 | {% block css %}
17 | {% endblock %}
18 |
19 | {% bootstrap_css %}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | {% block body %}
29 |
30 |
31 |
32 |
33 |
34 |
35 | {% if not request.path == '/' %}
36 |
keralarescue
37 | {% endif %}
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | {% block content %}
47 | {% endblock %}
48 |
49 |
50 |
51 | {% endblock %}
52 |
53 |
54 |
61 |
62 |
63 |
64 |
65 | {% bootstrap_javascript %}
66 |
67 | {% block javascript %}
68 | {% endblock %}
69 |
70 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/static/images/kerala-government.png:
--------------------------------------------------------------------------------
1 | Error 403 (Forbidden)!!1 403. That’s an error.
Your client does not have permission to get URL /tcWE-FWztpRG31jJiAbOeEqAGclvveJSnEryytmrXg3GiiLH-DGwDrzYmx_KwJkOKLI6U-GRtHHX-s2pvr-2-ohYgTBP0xuHH_pd4qX5NxHD2NSJ8MYw8Le20ph5DRJpC4N9tQCYd805mONRUy0kZBTFxGHlx1mvJ6Mg2LGMUEjwTgceRp1cQcqC4hDFzXAwYDtOyO8gljzb79PGSo59-l8unzn_nASORp18A1LPj0twG3Z_qG4FvsypwfTAoKx-IROMeimKbTnHZqdc9VtOktXB3RqNj38Mdt8P9lAQPWkBuL-w2jSLnF7ck9RUhRPEDYNooKBf3M89m4k6k9qxiohlIt5rlG_6pH-sO-F8rKnQ_-_JMW_rJhI3p8stwN6zLaxasoRxxBsYyPdIaGSMt0S0oHSqxPszISBSoxQVynJ6do-l2MkH8eTUF9wK3wE0o57aMsszJlYoAwCl5k7AcbaP5hpGMBtOZ7EC4LIURoaKl_0KTvbT6i3fgDvLPVxi0riRFXAB1tSBWq8nUlwpruSDuOPRBzV8b4naaBmBmlfHJbd6CtNAkfejtK93LDiJ2PzUkYEcblE1KdkSKK-BH_BCsQym2eO-AWcIiMEJ4EyRunM1hAF0fKNfxqkS7uHNoDBElqXfL6pl0zD_CtSGcxYnLSBBkTEaBJxwM89CcJuAPgYZaRa_-ZdPU4ow=w1600-h1000-l75-ft from this server. (Client IP address: 112.133.229.103)
2 | Forbidden
3 |
4 | That’s all we know.
--------------------------------------------------------------------------------
/templates/home.html:
--------------------------------------------------------------------------------
1 | {% extends 'base.html' %}
2 | {% load static %}
3 | {% block content %}
4 |
5 | {% load bootstrap3 %}
6 |
7 |
65 | {% endblock %}
66 |
--------------------------------------------------------------------------------
/static/css/style.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #ededed;
3 | font-family: 'Raleway';
4 | }
5 | .navbar{
6 | padding: 15px 30px;
7 | margin-bottom: 5px;
8 | }
9 | .brand-logo,.brand-logo:hover{
10 | font-size: 24px;
11 | color: #333333;
12 | border: 2px solid #333333;
13 | padding: 6px 10px;
14 | font-weight: 500;
15 | text-decoration: none;
16 | display:inline-block;margin-top:5px;
17 | }
18 | .nav-logo{
19 | height: 60px;
20 | }
21 | .backtohome{
22 | float:right;
23 | color: #333333;
24 | }
25 | .contactus{
26 | float:right;
27 | color: #333333;
28 | padding-right: 5px;
29 | }
30 | h1.main-logo{
31 | font-size: 6rem;
32 | display:block;
33 | color:#333333;
34 | font-weight: 600;
35 | margin-top:0;
36 | }
37 | a.home-button{
38 | padding: 15px;
39 | margin: 10px;
40 | border:2px solid #333333;
41 | color: #333333;
42 | border-radius: 5px;
43 | -moz-border-radius: 5px;
44 | -webkit-border-radius: 5px;
45 | text-decoration: none;
46 | width: 230px;
47 | height: 230px;
48 | vertical-align: top;
49 | display: inline-flex;
50 | justify-content: center;
51 | flex-direction: column;
52 | }
53 | a.home-button:hover{
54 | background: #333333;
55 | color:#FFFFFF;
56 | }
57 | a.home-button .glyphicon{
58 | font-size: 5rem;
59 | display: block;
60 | margin-bottom: 10px;
61 | }
62 | a.home-button .text{
63 | font-size: 2rem;
64 | font-weight: 500;
65 | text-transform: uppercase;
66 | display:inline-block;
67 | }
68 | a.home-button .ml{
69 | margin-top:7px;
70 | padding-top:7px;
71 | border-top: 1px dotted #555555;
72 | font-size: 1.4rem;
73 | font-weight: bold;
74 | text-transform: uppercase;
75 | display:inline-block;
76 | }
77 | p.home-info{
78 | font-size: 1.6rem;
79 | font-weight: 500;
80 | max-width: 800px;
81 | margin:30px auto 0;
82 | }
83 | form{
84 | width:96%;
85 | margin: 20px auto;
86 | max-width: 600px;
87 | }
88 | footer{
89 | margin: 40px 0;
90 | }
91 | .ml.small{
92 | font-size: 0.6em;
93 | }
94 | .footer-logo{
95 | height: 60px;
96 | margin: 15px;
97 | }
98 | @media screen and (max-width: 640px) {
99 | .brand-logo,.brand-logo:hover{
100 | font-size: 15px;
101 | padding: 3px 6px;
102 | margin-top: 0;
103 | }
104 | h1.main-logo{
105 | font-size: 3.5rem;
106 | margin-top:10px;
107 | }
108 | a.home-button .glyphicon{
109 | font-size: 3rem;
110 | margin-bottom: 15px;
111 | }
112 | a.home-button{
113 | display: inline-block;
114 | padding: 20px 10px;
115 | margin: 5px 10px;
116 | width: 80%;
117 | height: auto;
118 | }
119 | a.home-button .text{
120 | font-size: 2rem;
121 | }
122 |
123 | .nav-logo{
124 | height: 30px;
125 | }
126 | .footer-logo{
127 | height: 80px;
128 | display: block;
129 | margin: 15px auto;
130 | }
131 | }
132 |
133 | table {
134 | border-collapse: collapse;
135 | width: 100%;
136 | }
137 |
138 | td, th {
139 | border: 1px solid #cccccc;
140 | text-align: left;
141 | padding: 14px 8px;
142 | }
143 |
144 | tr:nth-child(even) {
145 | background-color: #E5E5E5;
146 | }
147 | tr:hover td{
148 | background-color: #dce9f1;
149 | }
150 |
--------------------------------------------------------------------------------
/mainapp/views.py:
--------------------------------------------------------------------------------
1 | from django.http import HttpResponse
2 | from django.shortcuts import render
3 | from django.views.generic.edit import CreateView
4 | from django.views.generic.base import TemplateView
5 | from .models import Request, Volunteer, DistrictManager, Contributor, DistrictNeed
6 | import django_filters
7 |
8 | class CreateRequest(CreateView):
9 | model = Request
10 | template_name='mainapp/request_form.html'
11 | fields = [
12 | 'district',
13 | 'location',
14 | 'requestee',
15 | 'requestee_phone',
16 | 'needwater',
17 | 'detailwater',
18 | 'needfood',
19 | 'detailfood',
20 | 'needcloth',
21 | 'detailcloth',
22 | 'needmed',
23 | 'detailmed',
24 | 'needkit_util',
25 | 'detailkit_util',
26 | 'needtoilet',
27 | 'detailtoilet',
28 | 'needothers'
29 | ]
30 | success_url = '/req_sucess'
31 |
32 |
33 | class RegisterVolunteer(CreateView):
34 | model = Volunteer
35 | fields = ['name', 'district', 'phone', 'organisation', 'address',]
36 | success_url = '/reg_success'
37 |
38 |
39 | class RegisterContributor(CreateView):
40 | model = Contributor
41 | fields = ['name', 'district', 'phone', 'address', 'commodities']
42 | success_url = '/contrib_success'
43 |
44 |
45 | class HomePageView(TemplateView):
46 | template_name = "home.html"
47 |
48 |
49 | class ReqSuccess(TemplateView):
50 | template_name = "mainapp/req_success.html"
51 |
52 |
53 | class RegSuccess(TemplateView):
54 | template_name = "mainapp/reg_success.html"
55 |
56 |
57 | class ContribSuccess(TemplateView):
58 | template_name = "mainapp/contrib_success.html"
59 |
60 |
61 | class DistNeeds(TemplateView):
62 | template_name = "mainapp/district_needs.html"
63 |
64 | def get_context_data(self, **kwargs):
65 | # Call the base implementation first to get a context
66 | context = super().get_context_data(**kwargs)
67 | # Add in a QuerySet of all the books
68 | context['district_data'] = DistrictNeed.objects.all()
69 | return context
70 |
71 |
72 |
73 |
74 | class RequestFilter(django_filters.FilterSet):
75 | class Meta:
76 | model = Request
77 | # fields = ['district', 'status', 'needwater', 'needfood', 'needcloth', 'needmed', 'needkit_util', 'needtoilet', 'needothers',]
78 | fields = ['district', 'status']
79 |
80 | def __init__(self, *args, **kwargs):
81 | super(RequestFilter, self).__init__(*args, **kwargs)
82 | # at startup user doen't push Submit button, and QueryDict (in data) is empty
83 | if self.data == {}:
84 | self.queryset = self.queryset.none()
85 |
86 |
87 | def request_list(request):
88 | filter = RequestFilter(request.GET, queryset=Request.objects.all())
89 | return render(request, 'mainapp/request_list.html', {'filter': filter})
90 |
91 |
92 | class DistrictManagerFilter(django_filters.FilterSet):
93 | class Meta:
94 | model = DistrictManager
95 | fields = ['district']
96 |
97 | def __init__(self, *args, **kwargs):
98 | super(DistrictManagerFilter, self).__init__(*args, **kwargs)
99 | # at startup user doen't push Submit button, and QueryDict (in data) is empty
100 | if self.data == {}:
101 | self.queryset = self.queryset.none()
102 |
103 | def districtmanager_list(request):
104 | filter = DistrictManagerFilter(request.GET, queryset=DistrictManager.objects.all())
105 | return render(request, 'mainapp/districtmanager_list.html', {'filter': filter})
106 |
--------------------------------------------------------------------------------
/mainapp/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | districts = (
4 | ('tvm','Thiruvananthapuram'),
5 | ('ptm','Pathanamthitta'),
6 | ('alp','Alappuzha'),
7 | ('ktm','Kottayam'),
8 | ('idk','Idukki'),
9 | ('mpm','Malappuram'),
10 | ('koz','Kozhikode'),
11 | ('wnd','Wayanad'),
12 | ('knr','Kannur'),
13 | ('ksr','Kasaragod'),
14 | ('pkd','Palakkad'),
15 | ('tcr','Thrissur'),
16 | ('ekm','Ernakulam'),
17 | ('kol','Kollam'),
18 | )
19 |
20 | status_types =(
21 | ('new', 'New'),
22 | ('pro', 'In progess'),
23 | ('sup', 'Supplied'),
24 | )
25 |
26 | contrib_status_types =(
27 | ('new', 'New'),
28 | ('ful', 'Fullfilled'),
29 | )
30 |
31 | class Request(models.Model):
32 | district = models.CharField(
33 | max_length = 15,
34 | choices = districts,
35 | verbose_name='Districts - ജില്ല'
36 | )
37 | location = models.CharField(max_length=500,verbose_name='Location - സ്ഥലം')
38 | requestee = models.CharField(max_length=100,verbose_name='Requestee - അപേക്ഷകന്റെ പേര്')
39 | requestee_phone = models.CharField(max_length=10,verbose_name='Requestee Phone - അപേക്ഷകന്റെ ഫോണ് നമ്പര്')
40 |
41 | needwater = models.BooleanField(verbose_name='Water - വെള്ളം')
42 | needfood = models.BooleanField(verbose_name='Food - ഭക്ഷണം')
43 | needcloth = models.BooleanField(verbose_name='Clothing - വസ്ത്രം')
44 | needmed = models.BooleanField(verbose_name='Medicine - മരുന്നുകള്')
45 | needtoilet = models.BooleanField(verbose_name='Toiletries - ശുചീകരണ സാമഗ്രികള് ')
46 | needkit_util = models.BooleanField(verbose_name='Kitchen utensil - അടുക്കള സാമഗ്രികള്')
47 |
48 | detailwater = models.CharField(max_length=250, verbose_name='Details for required water - ആവശ്യമായ വെള്ളത്തിന്റെ വിവരങ്ങള്', blank=True)
49 | detailfood = models.CharField(max_length=250, verbose_name='Details for required food - ആവശ്യമായ ഭക്ഷണത്തിന്റെ വിവരങ്ങള്', blank=True)
50 | detailcloth = models.CharField(max_length=250, verbose_name='Details for required clothing - ആവശ്യമായ വസ്ത്രത്തിന്റെ വിവരങ്ങള്', blank=True)
51 | detailmed = models.CharField(max_length=250, verbose_name='Details for required medicine - ആവശ്യമായ മരുന്നിന്റെ വിവരങ്ങള്', blank=True)
52 | detailtoilet = models.CharField(max_length=250, verbose_name='Details for required toiletries - ആവശ്യമായ ശുചീകരണ സാമഗ്രികള്', blank=True)
53 | detailkit_util = models.CharField(max_length=250, verbose_name='Details for required kitchen utensil - ആവശ്യമായ അടുക്കള സാമഗ്രികള്', blank=True)
54 |
55 | needothers = models.CharField(max_length=500, verbose_name="Other needs - മറ്റു ആവശ്യങ്ങള്", blank=True)
56 | status = models.CharField(
57 | max_length = 10,
58 | choices = status_types,
59 | default = 'new'
60 | )
61 | supply_details = models.CharField(max_length=100, blank=True)
62 | dateadded = models.DateTimeField(auto_now_add=True)
63 |
64 | def __str__(self):
65 | return self.get_district_display() + ' ' + self.location
66 |
67 | class Volunteer(models.Model):
68 | district = models.CharField(
69 | max_length = 15,
70 | choices = districts,
71 | )
72 | name = models.CharField(max_length=100)
73 | phone = models.CharField(max_length=10)
74 | organisation = models.CharField(max_length=250, verbose_name="Organization (സംഘടന) / College")
75 | address = models.TextField()
76 | is_spoc = models.BooleanField(default=False, verbose_name="Is point of contact")
77 | joined = models.DateTimeField(auto_now_add=True)
78 |
79 | def __str__(self):
80 | return self.name
81 |
82 |
83 | class Contributor(models.Model):
84 | district = models.CharField(
85 | max_length = 15,
86 | choices = districts,
87 | )
88 | name = models.CharField(max_length=100)
89 | phone = models.CharField(max_length=10)
90 | address = models.TextField()
91 | commodities = models.TextField(verbose_name="What you can contribute. ( സംഭാവന ചെയ്യാന് ഉദ്ദേശിക്കുന്ന സാധനങ്ങള് ) -- Eg: Shirts, torches etc ")
92 | status = models.CharField(
93 | max_length = 10,
94 | choices = contrib_status_types,
95 | default = 'new'
96 | )
97 |
98 | def __str__(self):
99 | return self.name + ' ' + self.get_district_display()
100 |
101 |
102 | class DistrictManager(models.Model):
103 | district = models.CharField(
104 | max_length = 15,
105 | choices = districts,
106 | )
107 | name = models.CharField(max_length=100)
108 | phone = models.CharField(max_length=10)
109 | email = models.CharField(max_length=100)
110 |
111 | def __str__(self):
112 | return self.name + ' ' + self.get_district_display()
113 |
114 | class DistrictNeed(models.Model):
115 | district = models.CharField(
116 | max_length = 15,
117 | choices = districts,
118 | )
119 | needs = models.TextField(verbose_name="Items required")
120 | cnandpts = models.TextField(verbose_name="Contacts and collection points") #contacts and collection points
121 |
122 | def __str__(self):
123 | return self.get_district_display()
124 |
125 | class DistrictCollection(models.Model):
126 | district = models.CharField(
127 | max_length=15,
128 | choices=districts
129 | )
130 | collection = models.TextField(
131 | verbose_name="Details of collected items"
132 | )
133 |
--------------------------------------------------------------------------------
/floodrelief/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for floodrelief project.
3 |
4 | Generated by 'django-admin startproject' using Django 2.1.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/2.1/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/2.1/ref/settings/
11 | """
12 |
13 | import os
14 | import environ
15 |
16 | def get_list(text):
17 | return [item.strip() for item in text.split(',')]
18 |
19 | env = environ.Env(
20 | # set casting, default value
21 | DEBUG=(bool, False)
22 | )
23 | # reading .env file
24 | root = environ.Path(__file__) - 2
25 | environ.Env.read_env(root('.env'))
26 |
27 | # False if not in os.environ
28 | DEBUG = env('DEBUG')
29 |
30 | # Raises django's ImproperlyConfigured exception if SECRET_KEY not in os.environ
31 | SECRET_KEY = env('SECRET_KEY')
32 |
33 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
34 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
35 |
36 |
37 | # Quick-start development settings - unsuitable for production
38 | # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
39 |
40 | # ALLOWED_HOSTS = ['127.0.0.1', 'keralarescue.herokuapp.com', 'keralarescue.in', 'www.keralarescue.in', 'localhost']
41 | ALLOWED_HOSTS = get_list(os.environ.get('ALLOWED_HOSTS'))
42 |
43 | # Application definition
44 |
45 | INSTALLED_APPS = [
46 | 'mainapp.apps.MainappConfig',
47 | 'django.contrib.admin',
48 | 'django.contrib.auth',
49 | 'django.contrib.contenttypes',
50 | 'django.contrib.sessions',
51 | 'django.contrib.messages',
52 | 'django.contrib.staticfiles',
53 | 'bootstrap3',
54 | 'django_filters',
55 | ]
56 |
57 | MIDDLEWARE = [
58 | 'django.middleware.security.SecurityMiddleware',
59 | 'whitenoise.middleware.WhiteNoiseMiddleware',
60 | 'django.contrib.sessions.middleware.SessionMiddleware',
61 | 'django.middleware.common.CommonMiddleware',
62 | 'django.middleware.csrf.CsrfViewMiddleware',
63 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
64 | 'django.contrib.messages.middleware.MessageMiddleware',
65 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
66 | ]
67 |
68 | ROOT_URLCONF = 'floodrelief.urls'
69 |
70 | TEMPLATES = [
71 | {
72 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
73 | 'DIRS': ['templates'],
74 | 'APP_DIRS': True,
75 | 'OPTIONS': {
76 | 'context_processors': [
77 | 'django.template.context_processors.debug',
78 | 'django.template.context_processors.request',
79 | 'django.contrib.auth.context_processors.auth',
80 | 'django.contrib.messages.context_processors.messages',
81 | ],
82 | },
83 | },
84 | ]
85 |
86 | WSGI_APPLICATION = 'floodrelief.wsgi.application'
87 |
88 | # Database
89 | # https://docs.djangoproject.com/en/2.1/ref/settings/#databases
90 |
91 | DATABASES = {
92 | # read os.environ['DATABASE_URL'] and raises ImproperlyConfigured exception if not found
93 | 'default': env.db()
94 | }
95 |
96 |
97 | # Password validation
98 | # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
99 |
100 | AUTH_PASSWORD_VALIDATORS = [
101 | {
102 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
103 | },
104 | {
105 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
106 | },
107 | {
108 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
109 | },
110 | {
111 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
112 | },
113 | ]
114 |
115 | LOGGING = {
116 | 'version': 1,
117 | 'disable_existing_loggers': False,
118 | 'formatters': {
119 | 'verbose': {
120 | 'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
121 | 'datefmt' : "%d/%b/%Y %H:%M:%S"
122 | },
123 | 'simple': {
124 | 'format': '%(levelname)s %(message)s'
125 | },
126 | },
127 | 'handlers': {
128 | 'file': {
129 | 'level': 'DEBUG',
130 | 'class': 'logging.FileHandler',
131 | 'filename': 'mysite.log',
132 | 'formatter': 'verbose'
133 | },
134 | },
135 | 'loggers': {
136 | 'django': {
137 | 'handlers':['file'],
138 | 'propagate': True,
139 | 'level':'DEBUG',
140 | },
141 | 'MYAPP': {
142 | 'handlers': ['file'],
143 | 'level': 'DEBUG',
144 | },
145 | }
146 | }
147 |
148 | # Internationalization
149 | # https://docs.djangoproject.com/en/2.1/topics/i18n/
150 |
151 | LANGUAGE_CODE = 'en-us'
152 |
153 | TIME_ZONE = 'Asia/Kolkata'
154 |
155 | USE_I18N = True
156 |
157 | USE_L10N = True
158 |
159 | USE_TZ = True
160 |
161 |
162 | # Static files (CSS, JavaScript, Images)
163 | # https://docs.djangoproject.com/en/2.1/howto/static-files/
164 |
165 | STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
166 | # STATICFILES_STORAGE = 'floodrelief.storage.WhiteNoiseStaticFilesStorage'
167 | STATIC_URL = '/static/'
168 | STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
169 | STATICFILES_DIRS = (
170 | os.path.join(BASE_DIR, 'static'),
171 | )
172 |
173 | ADMIN_SITE_HEADER = "Keralarescue Dashboard"
174 |
--------------------------------------------------------------------------------