diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3ee39c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.pyc +.idea +venv +Include +Lib +Scripts +tcl \ No newline at end of file diff --git a/OpenCabpool/OpenCabpool/__init__.py b/OpenCabpool/OpenCabpool/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/OpenCabpool/OpenCabpool/settings.py b/OpenCabpool/OpenCabpool/settings.py new file mode 100644 index 0000000..8aa0a65 --- /dev/null +++ b/OpenCabpool/OpenCabpool/settings.py @@ -0,0 +1,122 @@ +""" +Django settings for OpenCabpool project. + +Generated by 'django-admin startproject' using Django 1.11.3. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.11/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '7$xdlxy*056=l@8#7!*scb#!3lwk*_xcy%^w8j5x*ot0*%8o)q' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'UserDetails', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'OpenCabpool.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'OpenCabpool.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.11/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.11/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.11/howto/static-files/ + +STATIC_URL = '/static/' +AUTH_USER_MODEL = 'UserDetails.User' diff --git a/OpenCabpool/OpenCabpool/urls.py b/OpenCabpool/OpenCabpool/urls.py new file mode 100644 index 0000000..8c78aba --- /dev/null +++ b/OpenCabpool/OpenCabpool/urls.py @@ -0,0 +1,21 @@ +"""OpenCabpool URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.11/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url +from django.contrib import admin + +urlpatterns = [ + url(r'^admin/', admin.site.urls), +] diff --git a/OpenCabpool/OpenCabpool/wsgi.py b/OpenCabpool/OpenCabpool/wsgi.py new file mode 100644 index 0000000..e0038da --- /dev/null +++ b/OpenCabpool/OpenCabpool/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for OpenCabpool project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "OpenCabpool.settings") + +application = get_wsgi_application() diff --git a/OpenCabpool/UserDetails/__init__.py b/OpenCabpool/UserDetails/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/OpenCabpool/UserDetails/admin.py b/OpenCabpool/UserDetails/admin.py new file mode 100644 index 0000000..99abfc2 --- /dev/null +++ b/OpenCabpool/UserDetails/admin.py @@ -0,0 +1,7 @@ +from django.contrib import admin +from django.contrib.auth.admin import UserAdmin +from .models import User + + +# Register your models here. +admin.site.register(User, UserAdmin) diff --git a/OpenCabpool/UserDetails/apps.py b/OpenCabpool/UserDetails/apps.py new file mode 100644 index 0000000..a8b7004 --- /dev/null +++ b/OpenCabpool/UserDetails/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class PoolmycarConfig(AppConfig): + name = 'PoolMyCar' diff --git a/OpenCabpool/UserDetails/migrations/0001_initial.py b/OpenCabpool/UserDetails/migrations/0001_initial.py new file mode 100644 index 0000000..3922576 --- /dev/null +++ b/OpenCabpool/UserDetails/migrations/0001_initial.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.3 on 2017-10-29 11:57 +from __future__ import unicode_literals + +import django.contrib.auth.models +import django.contrib.auth.validators +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('auth', '0008_alter_user_username_max_length'), + ] + + operations = [ + migrations.CreateModel( + name='Vehicle', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ], + ), + migrations.CreateModel( + name='User', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')), + ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')), + ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')), + ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')), + ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), + ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')), + ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), + ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')), + ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')), + ], + options={ + 'verbose_name': 'user', + 'verbose_name_plural': 'users', + 'abstract': False, + }, + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + ] diff --git a/OpenCabpool/UserDetails/migrations/__init__.py b/OpenCabpool/UserDetails/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/OpenCabpool/UserDetails/models.py b/OpenCabpool/UserDetails/models.py new file mode 100644 index 0000000..66ab252 --- /dev/null +++ b/OpenCabpool/UserDetails/models.py @@ -0,0 +1,26 @@ +from django.db import models +from django.contrib.auth.models import AbstractUser + + +# Create your models here. +class User(AbstractUser): + """ + We can discuss and create the fields that are essential for User apart from existing fields + I can think of + - phone number + - driver / passenger + """ + pass + + +class Vehicle(models.Model): + """ + We can discuss the details that are to be stored for a vehicle. + I can think of + - number of extra seats + - vehicle number + - foreign key relation with user + - color + - brand + """ + pass diff --git a/OpenCabpool/UserDetails/tests.py b/OpenCabpool/UserDetails/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/OpenCabpool/UserDetails/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/OpenCabpool/UserDetails/views.py b/OpenCabpool/UserDetails/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/OpenCabpool/UserDetails/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/OpenCabpool/db.sqlite3 b/OpenCabpool/db.sqlite3 new file mode 100644 index 0000000..2149edf Binary files /dev/null and b/OpenCabpool/db.sqlite3 differ diff --git a/OpenCabpool/manage.py b/OpenCabpool/manage.py new file mode 100644 index 0000000..7a1105d --- /dev/null +++ b/OpenCabpool/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "OpenCabpool.settings") + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv) diff --git a/README.md b/README.md index ed50ccd..0e649d7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ -# open-carpool +# OpenCarpool Open source carpooling app using Google Maps, built for community activities + +# Features [ As we progress ] + + - Login / Signin / Logout / Forgot Password + - Register Vehicle [Signin / After Signin] + - Create a Pool [ Rider / Passenger ] + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..22d85ae --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +Django==1.11.3 +djangorestframework==3.5.3 +pytz==2017.2