Skip to content

Commit c9e580a

Browse files
committed
Initial commit
0 parents  commit c9e580a

31 files changed

+1051
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/django
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=django
4+
5+
### Django ###
6+
*.log
7+
*.pot
8+
*.pyc
9+
__pycache__/
10+
local_settings.py
11+
db.sqlite3
12+
db.sqlite3-journal
13+
media
14+
.DS_Store
15+
.vscode/
16+
.vscode
17+
18+
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
19+
# in your Git repository. Update and uncomment the following line accordingly.
20+
# <django-project-name>/staticfiles/
21+
22+
### Django.Python Stack ###
23+
# Byte-compiled / optimized / DLL files
24+
*.py[cod]
25+
*$py.class
26+
27+
# C extensions
28+
*.so
29+
30+
# Distribution / packaging
31+
.Python
32+
build/
33+
develop-eggs/
34+
dist/
35+
downloads/
36+
eggs/
37+
.eggs/
38+
lib/
39+
lib64/
40+
parts/
41+
sdist/
42+
var/
43+
wheels/
44+
share/python-wheels/
45+
*.egg-info/
46+
.installed.cfg
47+
*.egg
48+
MANIFEST
49+
50+
# PyInstaller
51+
# Usually these files are written by a python script from a template
52+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
53+
*.manifest
54+
*.spec
55+
56+
# Installer logs
57+
pip-log.txt
58+
pip-delete-this-directory.txt
59+
60+
# Unit test / coverage reports
61+
htmlcov/
62+
.tox/
63+
.nox/
64+
.coverage
65+
.coverage.*
66+
.cache
67+
nosetests.xml
68+
coverage.xml
69+
*.cover
70+
*.py,cover
71+
.hypothesis/
72+
.pytest_cache/
73+
cover/
74+
75+
# Translations
76+
*.mo
77+
78+
# Django stuff:
79+
80+
# Flask stuff:
81+
instance/
82+
.webassets-cache
83+
84+
# Scrapy stuff:
85+
.scrapy
86+
87+
# Sphinx documentation
88+
docs/_build/
89+
90+
# PyBuilder
91+
.pybuilder/
92+
target/
93+
94+
# Jupyter Notebook
95+
.ipynb_checkpoints
96+
97+
# IPython
98+
profile_default/
99+
ipython_config.py
100+
101+
# pyenv
102+
# For a library or package, you might want to ignore these files since the code is
103+
# intended to run in multiple environments; otherwise, check them in:
104+
# .python-version
105+
106+
# pipenv
107+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
108+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
109+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
110+
# install all needed dependencies.
111+
#Pipfile.lock
112+
113+
# poetry
114+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
115+
# This is especially recommended for binary packages to ensure reproducibility, and is more
116+
# commonly ignored for libraries.
117+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
118+
#poetry.lock
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
#.idea/
169+
170+
# End of https://www.toptal.com/developers/gitignore/api/django

Home.png

427 KB
Loading

LICENSE

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

Login.png

313 KB
Loading

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Django ChatApp
2+
3+
Clean and simple to-do list application made with Django framework.
4+
5+
![](Home.png)
6+
7+
![](Login.png)
8+
9+
## Features
10+
11+
- Easy add, delete and edit tasks
12+
- Reorder items
13+
- Login and register
14+
- Mark tasks as completed
15+
- Clean UI
16+
17+
## Setup ##
18+
19+
1. Clone the project repository
20+
```bash
21+
git clone https://github.com/pycoder2000/djangochat.git
22+
```
23+
24+
2. Move to the project root folder.
25+
```bash
26+
cd djangochat
27+
```
28+
29+
3. Create and activate a virtual environment.
30+
> (for mac)
31+
```bash
32+
virtualenv env
33+
source env/bin/activate
34+
```
35+
36+
To deactivate the environment
37+
```bash
38+
deactivate
39+
```
40+
41+
4. Install requirements
42+
43+
```bash
44+
pip3 install -r requirements.txt
45+
```
46+
47+
5. Initialize database
48+
```bash
49+
python3 manage.py migrate
50+
```
51+
52+
6. Create admin user
53+
```bash
54+
python3 manage.py createsuperuser
55+
```
56+
57+
7. Run development server
58+
```bash
59+
python3 manage.py runserver
60+
```
61+
62+
## Directory Layout
63+
64+
```bash
65+
📦todo_list
66+
┣ 📂base
67+
┃ ┣ 📂templates
68+
┃ ┃ ┗ 📂base
69+
┃ ┃ ┃ ┣ 📜login.html
70+
┃ ┃ ┃ ┣ 📜main.html
71+
┃ ┃ ┃ ┣ 📜register.html
72+
┃ ┃ ┃ ┣ 📜task_confirm_delete.html
73+
┃ ┃ ┃ ┣ 📜task_detail.html
74+
┃ ┃ ┃ ┣ 📜task_form.html
75+
┃ ┃ ┃ ┗ 📜task_list.html
76+
┃ ┣ 📜admin.py
77+
┃ ┣ 📜apps.py
78+
┃ ┣ 📜forms.py
79+
┃ ┣ 📜models.py
80+
┃ ┣ 📜tests.py
81+
┃ ┣ 📜urls.py
82+
┃ ┗ 📜views.py
83+
┣ 📂todo_list
84+
┃ ┣ 📜asgi.py
85+
┃ ┣ 📜settings.py
86+
┃ ┣ 📜urls.py
87+
┃ ┗ 📜wsgi.py
88+
┣ 📜db.sqlite3
89+
┗ 📜manage.py
90+
```

base/__init__.py

Whitespace-only changes.

base/admin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from django.contrib import admin
2+
from .models import Task
3+
4+
admin.site.register(Task)

base/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 BaseConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'base'

base/forms.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from django import forms
2+
3+
class PositionForm(forms.Form):
4+
position = forms.CharField()

base/migrations/0001_initial.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Generated by Django 4.0.2 on 2022-02-22 03:37
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
initial = True
11+
12+
dependencies = [
13+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
14+
]
15+
16+
operations = [
17+
migrations.CreateModel(
18+
name='Task',
19+
fields=[
20+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21+
('title', models.CharField(max_length=200)),
22+
('description', models.TextField(blank=True, null=True)),
23+
('complete', models.BooleanField(default=False)),
24+
('create', models.DateTimeField(auto_now_add=True)),
25+
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
26+
],
27+
options={
28+
'ordering': ['complete'],
29+
},
30+
),
31+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.0.2 on 2022-02-22 17:50
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('base', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name='task',
15+
options={},
16+
),
17+
migrations.RenameField(
18+
model_name='task',
19+
old_name='create',
20+
new_name='created',
21+
),
22+
migrations.AlterOrderWithRespectTo(
23+
name='task',
24+
order_with_respect_to='user',
25+
),
26+
]

base/migrations/__init__.py

Whitespace-only changes.

base/models.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from django.db import models
2+
from django.contrib.auth.models import User
3+
4+
class Task(models.Model):
5+
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True)
6+
title = models.CharField(max_length=200)
7+
description = models.TextField(null=True, blank=True)
8+
complete = models.BooleanField(default=False)
9+
created = models.DateTimeField(auto_now_add=True)
10+
11+
def __str__(self):
12+
return self.title
13+
14+
class Meta:
15+
order_with_respect_to = 'user'

0 commit comments

Comments
 (0)