Skip to content

Commit b15c4bf

Browse files
author
felix13
committed
first commit
0 parents  commit b15c4bf

Some content is hidden

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

82 files changed

+3503
-0
lines changed

.gitignore

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
bin/
12+
build/
13+
develop-eggs/
14+
dist/
15+
eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
.vscode/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
26+
# Installer logs
27+
pip-log.txt
28+
pip-delete-this-directory.txt
29+
30+
# Unit test / coverage reports
31+
htmlcov/
32+
.tox/
33+
.coverage
34+
.cache
35+
nosetests.xml
36+
coverage.xml
37+
38+
# Translations
39+
*.mo
40+
41+
# Mr Developer
42+
.mr.developer.cfg
43+
.project
44+
.pydevproject
45+
46+
# Rope
47+
.ropeproject
48+
49+
# Django stuff:
50+
*.log
51+
*.pot
52+
53+
# Sphinx documentation
54+
docs/_build/
55+
56+
.DS_Store
57+
*.sqlite3
58+
media/
59+
60+
.env
61+
62+
venv_bootcamp/
63+
staticfiles

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Felix KImutai
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.

LICENSE~

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Vitor Freitas
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.

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Vidakali
2+
3+
Vidakali is an open source **online video sharing and social media platform** built with [Python][0] using the [Django Web Framework][1].
4+
5+
6+
## Technology Stack
7+
8+
- Python 3.5
9+
- Django 2.2.13
10+
- Twitter Bootstrap 4
11+
12+
13+
## Running Locally
14+
15+
16+
17+
```bash
18+
python manage.py migrate
19+
```
20+
21+
```bash
22+
python manage.py runserver
23+
```
24+

README.md~

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Vidakali
2+
3+
Vidakali is an open source **online video sharing and social media platform** built with [Python][0] using the [Django Web Framework][1].
4+
5+
6+
## Technology Stack
7+
8+
- Python 3.5
9+
- Django 2.2.13
10+
- Twitter Bootstrap 4
11+
12+
13+

accounts/__init__.py

Whitespace-only changes.

accounts/admin.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from django.contrib import admin
2+
from django.contrib.auth.models import Group
3+
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
4+
5+
from .forms import CustomUserCreationForm
6+
from .models import CustomUser
7+
8+
9+
class UserAdmin(BaseUserAdmin):
10+
add_form = CustomUserCreationForm
11+
list_display = ('username', 'email', 'is_admin')
12+
list_filter = ('is_admin',)
13+
fieldsets = (
14+
(None, {'fields': ('username', 'email', 'password', 'avatar')}),
15+
('Permissions', {'fields': ('is_admin',)})
16+
)
17+
search_fields = ('username', 'email')
18+
ordering = ('username', 'email')
19+
20+
filter_horizontal = ()
21+
22+
23+
admin.site.register(CustomUser, UserAdmin)
24+
admin.site.unregister(Group)

accounts/admin.py~

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from django.contrib import admin
2+
from django.contrib.auth.models import Group
3+
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
4+
5+
from .forms import CustomUserCreationForm
6+
from .models import CustomUser
7+
8+
9+
class UserAdmin(BaseUserAdmin):
10+
add_form = CustomUserCreationForm
11+
list_display = ('username', 'email', 'is_admin')
12+
list_filter = ('is_admin',)
13+
fieldsets = (
14+
(None, {'fields': ('username', 'email', 'password', 'avatar')}),
15+
('Permissions', {'fields': ('is_admin',)})
16+
)
17+
search_fields = ('username', 'email')
18+
ordering = ('username', 'email')
19+
20+
filter_horizontal = ()
21+
22+
23+
admin.site.register(CustomUser, UserAdmin)
24+
admin.site.unregister(Group)

accounts/apps.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class AccountsConfig(AppConfig):
5+
name = 'accounts'

accounts/forms.py

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
from django import forms
2+
from django.contrib.auth.forms import UserCreationForm
3+
4+
from .models import CustomUser
5+
6+
7+
class CustomUserCreationForm(UserCreationForm):
8+
9+
username = forms.CharField(
10+
label='Username',
11+
max_length=100,
12+
min_length=5,
13+
widget=forms.TextInput(attrs={'class': 'form-control'}))
14+
email = forms.EmailField(
15+
widget=forms.TextInput(attrs={'class': 'form-control'}))
16+
password1 = forms.CharField(
17+
label="Password",
18+
max_length=100,
19+
min_length=5,
20+
widget=forms.PasswordInput(attrs={'class': 'form-control'}))
21+
password2 = forms.CharField(
22+
label="Confirm Password",
23+
max_length=100,
24+
min_length=5,
25+
widget=forms.PasswordInput(attrs={'class': 'form-control'}))
26+
27+
class Meta:
28+
model = CustomUser
29+
fields = ('username', 'email', 'password1', 'password2')
30+
31+
32+
class ProfileForm(forms.ModelForm):
33+
34+
username = forms.CharField(
35+
label='Username',
36+
max_length=100,
37+
min_length=5,
38+
widget=forms.TextInput(attrs={'class': 'form-control'}))
39+
email = forms.EmailField(
40+
widget=forms.TextInput(attrs={'class': 'form-control'}))
41+
42+
class Meta:
43+
model = CustomUser
44+
fields = ['username', 'email', 'avatar', ]

accounts/forms.py~

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
from django import forms
2+
from django.contrib.auth.forms import UserCreationForm
3+
4+
from .models import CustomUser
5+
6+
7+
8+
9+
class CustomUserCreationForm(UserCreationForm):
10+
11+
username = forms.CharField(
12+
label='Username',
13+
max_length=100,
14+
min_length=5,
15+
widget=forms.TextInput(attrs={'class': 'form-control'}))
16+
email = forms.EmailField(
17+
widget=forms.TextInput(attrs={'class': 'form-control'}))
18+
password1 = forms.CharField(
19+
label="Password",
20+
max_length=100,
21+
min_length=5,
22+
widget=forms.PasswordInput(attrs={'class': 'form-control'}))
23+
password2 = forms.CharField(
24+
label="Confirm Password",
25+
max_length=100,
26+
min_length=5,
27+
widget=forms.PasswordInput(attrs={'class': 'form-control'}))
28+
29+
class Meta:
30+
model = CustomUser
31+
fields = ('username', 'email', 'password1', 'password2')
32+
33+
34+
class ProfileForm(forms.ModelForm):
35+
36+
username = forms.CharField(
37+
label='Username',
38+
max_length=100,
39+
min_length=5,
40+
widget=forms.TextInput(attrs={'class': 'form-control'}))
41+
email = forms.EmailField(
42+
widget=forms.TextInput(attrs={'class': 'form-control'}))
43+
44+
class Meta:
45+
model = CustomUser
46+
fields = ['username', 'email', 'avatar', ]

accounts/migrations/0001_initial.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Generated by Django 2.2.13 on 2021-06-03 06:35
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='CustomUser',
16+
fields=[
17+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('password', models.CharField(max_length=128, verbose_name='password')),
19+
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
20+
('username', models.CharField(max_length=300, unique=True)),
21+
('email', models.EmailField(max_length=255, unique=True, verbose_name='email address')),
22+
('is_admin', models.BooleanField(default=False)),
23+
('is_staff', models.BooleanField(default=False)),
24+
],
25+
options={
26+
'abstract': False,
27+
},
28+
),
29+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 2.2.13 on 2021-06-03 11:45
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('accounts', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='customuser',
15+
name='avatar',
16+
field=models.ImageField(blank=True, null=True, upload_to='avatars/'),
17+
),
18+
]

accounts/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)