Commit 88fa648f authored by Jan Ericsson Ong Ang's avatar Jan Ericsson Ong Ang

Jan

Added the different apps into the project, created and edited the url.py files for each app and edited the views.py to display what was needed. Edited the settings.py and urls.py of the Django project itself
parent 03b07df8
# Default ignored files
/shelf/
/workspace.xml
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/myenv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (janang_music) (2)" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/janang_music.iml" filepath="$PROJECT_DIR$/.idea/janang_music.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
from django.urls import path
from .views import index
urlpatterns = [
path('', index, name="index"),
]
app_name = "about"
\ No newline at end of file
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse('Jan Ang, aka Generic, is a second year BS CS student studying in Ateneo de Manila '
'University. He has no particular music interest but usually vibes with any music played by '
'his friends!')
from django.urls import path
from .views import index
urlpatterns = [
path('', index, name="index"),
]
app_name = "contact"
\ No newline at end of file
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("Name: Jan Ericsson O. Ang | OBF Email: ericsson.ang@obf.ateneo.edu | ID Number: 210359")
\ No newline at end of file
from django.db import models
# Create your models here.
class IndexCard(models.Model):
artist_name=models.CharField(max_length=420)
monthly_listeners = models.IntegerField(default=0)
class Album(models.Model):
album_name = models.CharField(max_length=50)
artist = models.CharField(max_length=50)
description = models.CharField(max_length=500)
release_date = models.DateTimeField("date released")
class Song(models.Model):
song_title = models.CharField(max_length = 50)
artist = models.CharField(max_length = 50)
album = models.CharField(max_length = 50)
song_length = models.IntegerField()
\ No newline at end of file
from django.urls import path
from .views import index
urlpatterns = [
path('', index, name="index"),
]
app_name = "homepage"
\ No newline at end of file
from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse('Welcome to Jan’s Music Library!')
\ No newline at end of file
......@@ -37,6 +37,9 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'homepage',
'about',
'contact',
]
MIDDLEWARE = [
......
......@@ -14,8 +14,11 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import include, path
urlpatterns = [
path('homepage/', include('homepage.urls', namespace='homepage')),
path('about/', include('about.urls', namespace='about')),
path('contact/', include('contact.urls', namespace='contact')),
path('admin/', admin.site.urls),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment