Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finished Login, Signup, Reset Password #19

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
main/__pycache__


# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
lushlyric
# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "D:\\Python_Interpretor\\python.exe"
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The first thing to do is to clone the repository:

```sh
$ git clone https://github.com/mohammedwed/Lushlyrics-insecure.git
$ git clone https://github.com/mohammedwed/lushlyrics-webapp-django.git
$ cd lushlyrics-webapp-django
```

Expand All @@ -27,7 +27,7 @@ session operates in a virtual environment set up by `virtualenv2`.

Once `pip` has finished downloading the dependencies:
```sh
(env)$ cd Lushlyrics-insecure
(env)$ cd spotify-clone-django
(env)$ python manage.py runserver
```
And navigate to `http://127.0.0.1:8000/`.
And navigate to `http://127.0.0.1:8000/demo`.
Binary file modified db.sqlite3
Binary file not shown.
Binary file removed lushlyrics-webapp-django-main.zip
Binary file not shown.
Empty file added main/__init__.py
Empty file.
Binary file added main/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file added main/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file added main/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added main/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added main/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file added main/__pycache__/admin.cpython-36.pyc
Binary file not shown.
Binary file added main/__pycache__/admin.cpython-37.pyc
Binary file not shown.
Binary file added main/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added main/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file added main/__pycache__/models.cpython-36.pyc
Binary file not shown.
Binary file added main/__pycache__/models.cpython-37.pyc
Binary file not shown.
Binary file added main/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added main/__pycache__/urls.cpython-312.pyc
Binary file not shown.
Binary file added main/__pycache__/urls.cpython-36.pyc
Binary file not shown.
Binary file added main/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file added main/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added main/__pycache__/views.cpython-312.pyc
Binary file not shown.
Binary file added main/__pycache__/views.cpython-36.pyc
Binary file not shown.
Binary file added main/__pycache__/views.cpython-37.pyc
Binary file not shown.
Binary file added main/__pycache__/views.cpython-38.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions main/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.contrib import admin
from .models import playlist_user, playlist_song
# Register your models here.
admin.site.register(playlist_user)
admin.site.register(playlist_song)
35 changes: 35 additions & 0 deletions main/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by Django 3.0.7 on 2020-11-17 13:13

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='playlist_user',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('username', models.CharField(max_length=200)),
],
),
migrations.CreateModel(
name='playlist_song',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('song_title', models.CharField(max_length=200)),
('song_youtube_id', models.CharField(max_length=20)),
('song_albumsrc', models.CharField(max_length=255)),
('song_dur', models.CharField(max_length=7)),
('song_channel', models.CharField(max_length=100)),
('song_date_added', models.CharField(max_length=12)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.playlist_user')),
],
),
]
Empty file added main/migrations/__init__.py
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added main/migrations/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file added main/migrations/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file added main/migrations/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file added main/migrations/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
23 changes: 23 additions & 0 deletions main/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from django.db import models


# Create your models here.
class playlist_user(models.Model):
username = models.CharField(max_length=200)

def __str__(self):
return f'Username = {self.username}, Liked Songs = {list(self.playlist_song_set.all())}'

class playlist_song(models.Model):
user = models.ForeignKey(playlist_user, on_delete=models.CASCADE)
song_title = models.CharField(max_length=200)
song_youtube_id = models.CharField(max_length=20)
song_albumsrc = models.CharField(max_length=255)
song_dur = models.CharField(max_length=7)
song_channel = models.CharField(max_length=100)
song_date_added = models.CharField(max_length=12)

def __str__(self):
return f'Title = {self.song_title}, Date = {self.song_date_added}'


20 changes: 20 additions & 0 deletions main/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth import views as auth_views

urlpatterns = [
path("", views.default, name='default'),
path("playlist/", views.playlist, name='your_playlists'),
path("search/", views.search, name='search_page'),
path("login", views.login_view, name='login_page'),
path("signup", views.signup_view, name='signup_page'),
path('logout/', views.logout_view, name='logout'),
path('forgot-password/', views.CustomPasswordResetView.as_view(), name='forgot-password'),
path('password_reset/done/', views.CustomPasswordResetDoneView.as_view(), name='password_reset_done'),
path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html'), name='password_reset_confirm'),
path('reset/done/', auth_views.PasswordResetCompleteView.as_view(template_name='password_reset_complete.html'), name='password_reset_complete'),


]
Loading