Skip to content

Commit 42ba077

Browse files
committed
boilerplate completed
0 parents  commit 42ba077

37 files changed

+1598
-0
lines changed

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
#Pycharm and VS Code
4+
.idea
5+
.vscode
6+
7+
# dependencies
8+
node_modules
9+
media
10+
/media
11+
*.sqlite3
12+
13+
# ignore migrations
14+
**/migrations/
15+
16+
# testing
17+
/coverage
18+
19+
# production
20+
/build
21+
/documentation
22+
23+
# misc
24+
**/__pycache__/
25+
.DS_Store
26+
.env.local
27+
.env.development.local
28+
.env.test.local
29+
.env.production.local
30+
31+
npm-debug.log*
32+
yarn-debug.log*
33+
yarn-error.log*
34+
35+
# Ignore virtual environment
36+
venv

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use an official Python runtime as the base image
2+
FROM python:3.9
3+
4+
# Set the working directory in the container
5+
WORKDIR /app
6+
7+
# Copy the requirements file into the container
8+
COPY requirements.txt .
9+
10+
# Install the project dependencies
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# Copy the project code into the container
14+
COPY . .
15+
16+
# Expose the port that the Django app will run on
17+
EXPOSE 8000
18+
19+
# Run the Django development server
20+
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Amit Prafulla (Apfirebolt)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
2+
![Django](https://img.shields.io/badge/Django-092E20?style=for-the-badge&logo=django&logoColor=green)
3+
![Django Rest Framework](https://img.shields.io/badge/django%20rest-ff1709?style=for-the-badge&logo=django&logoColor=white)
4+
![JavaScript](https://img.shields.io/badge/javascript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black)
5+
![Swagger](https://img.shields.io/badge/-Swagger-%23Clojure?style=for-the-badge&logo=swagger&logoColor=white)
6+
![Tailwind CSS](https://img.shields.io/badge/-Tailwind%20CSS-%2338B2AC?style=for-the-badge&logo=tailwind-css&logoColor=white)
7+
8+
# Quora Clone
9+
10+
A Quora clone using Django and Vue.

accounts/__init__.py

Whitespace-only changes.

accounts/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

accounts/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class AccountsConfig(AppConfig):
5+
default_auto_field = "django.db.models.BigAutoField"
6+
name = "accounts"

accounts/models.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
from django.db import models
2+
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser, PermissionsMixin
3+
4+
5+
class CustomUserManager(BaseUserManager):
6+
7+
def create_user(self, email, password=None, **extra_fields):
8+
"""Create, save and return a new user."""
9+
if not email:
10+
raise ValueError('User must have an email address.')
11+
user = self.model(email=self.normalize_email(email), **extra_fields)
12+
user.set_password(password)
13+
user.save(using=self._db)
14+
15+
return user
16+
17+
def create_superuser(self, email, password):
18+
user = self.model(email=email)
19+
user.set_password(password)
20+
user.is_superuser = True
21+
user.is_active = True
22+
user.is_staff = True
23+
user.save(using=self._db)
24+
return user
25+
26+
27+
class CustomUser(AbstractBaseUser, PermissionsMixin):
28+
email = models.EmailField("Email", unique=True, max_length=255)
29+
username = models.CharField("User Name", unique=True, max_length=255, blank=True, null=True)
30+
firstName = models.CharField("First Name", max_length=100, blank=True, null=True)
31+
lastName = models.CharField("Last Name", max_length=100, blank=True, null=True)
32+
profilePicture = models.ImageField("Profile Picture", upload_to='profile_pictures/', blank=True, null=True)
33+
is_active = models.BooleanField('Active', default=True)
34+
is_staff = models.BooleanField('Staff', default=False)
35+
is_superuser = models.BooleanField('Super User', default=False)
36+
objects = CustomUserManager()
37+
USERNAME_FIELD = 'email'
38+
39+
def __str__(self):
40+
return self.email
41+
42+
class Meta:
43+
'''Doc string for meta'''
44+
verbose_name_plural = "User"
45+
46+

accounts/tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

accounts/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

client/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

client/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Vue 3 + Vite
2+
3+
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4+
5+
## Recommended IDE Setup
6+
7+
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

client/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + Vue</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.js"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)