Commit 9ef16622 authored by Brian Guadalupe's avatar Brian Guadalupe

Merge branch 'test' into 'master'

Adds preliminary design and static file loading support

See merge request brian/mymusiclist!1
parents 1938e131 dd56a2a7
.DS_Store
*.pyc
*.sqlite
No preview for this file type
.signup_form{
color: black;
}
#nav_bar{
position:fixed;
width : 100vw;
list-style-type: none;
background-color: grey;
overflow: hidden;
margin : -15px;
margin-top: -70px;
padding: 0px;
height : 50px;
}
#nav_bar_items {
float: left;
display: block;
color: white;
font-size: 20;
padding: 8px 10px;
letter-spacing: 3px;
text-decoration: none;
}
li a:hover, .active{
background-color: black;
}
body {
color: white;
margin: 15px;
margin-top: 70px;
background-image: url(/files/images/background.jpg);
background-position: left top;
background-size: cover;
}
\ No newline at end of file
...@@ -100,6 +100,13 @@ AUTH_PASSWORD_VALIDATORS = [ ...@@ -100,6 +100,13 @@ AUTH_PASSWORD_VALIDATORS = [
}, },
] ]
STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
]
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "files"),
]
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/ # https://docs.djangoproject.com/en/1.11/topics/i18n/
...@@ -118,6 +125,7 @@ USE_TZ = True ...@@ -118,6 +125,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/ # https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/files/'
STATIC_ROOT = '/files/'
LOGIN_REDIRECT_URL = '/' LOGIN_REDIRECT_URL = '/'
...@@ -17,6 +17,7 @@ from django.conf.urls import url ...@@ -17,6 +17,7 @@ from django.conf.urls import url
from django.contrib import admin from django.contrib import admin
from django.contrib.auth import views as auth_views from django.contrib.auth import views as auth_views
from core import views as core_views from core import views as core_views
"""import * pls"""
urlpatterns = [ urlpatterns = [
url(r'^login/$', auth_views.login, {'template_name': 'login.html'}, name='login'), url(r'^login/$', auth_views.login, {'template_name': 'login.html'}, name='login'),
......
{% load static %}
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>{% block title %}MyMusicList{% endblock %}</title> <title>{% block title %}MyMusicList{% endblock %}</title>
<link rel="stylesheet" href="{% static 'css/mymusiclist.css' %}">
</head> </head>
<body> <body>
<header> <header>
<h1>MyMusicList</h1>
{% if user.is_authenticated %} {% if user.is_authenticated %}
Hi {{ user.username }}! <ul id='nav_bar'>
<a href="{% url 'logout' %}">logout</a> <li id='nav_bar_items'><a id='nav_bar_items' href="/">MyMusicList</a></li>
<li id='nav_bar_items'><a id='nav_bar_items' href="/profile/{{user.username}}">Hi, {{user.username}}</a></li>
<li id='nav_bar_items' style="float:right"><a id='nav_bar_items' href="{% url 'logout' %}">Logout</a></li>
</ul>
{% else %} {% else %}
<a href="{% url 'login' %}">login</a> <ul id='nav_bar'>
<a href="{% url 'signup' %}">sign up</a> <li id='nav_bar_items'><a id='nav_bar_items' href="/">MyMusicList</a></li>
<li id='nav_bar_items'><a id='nav_bar_items' href="{% url 'login' %}">Login</a></li>
<li id='nav_bar_items'><a id='nav_bar_items' href="{% url 'signup' %}">Sign Up</a></li>
</ul>
{% endif %} {% endif %}
</header> </header>
<main> <main>
......
...@@ -5,6 +5,5 @@ ...@@ -5,6 +5,5 @@
{% block content %} {% block content %}
<h2>Home</h2> <h2>Home</h2>
{% if user.is_authenticated %} {% if user.is_authenticated %}
<a href="/profile/{{user.username}}">View your profile</a>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
{% block content %} {% block content %}
<h2>Logged out</h2> <h2>Logged out</h2>
<p>You have been successfully logged out.</p> <p>
<p><a href="{% url 'login' %}">Log in</a> again.</p> You have been successfully logged out. <br> Please login again.
</p>
{% endblock %} {% endblock %}
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
{% block title %}Login{% endblock %} {% block title %}Login{% endblock %}
{% block content %} {% block content %}
<h2>Login</h2> <h2 id='login_login'>Login</h2>
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<button type="submit">Login</button> <button type="submit" id='login_submit'>Login</button>
</form> </form>
{% endblock %} {% endblock %}
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
{% block content %} {% block content %}
<h2>Sign up</h2> <h2>Sign up</h2>
<div class='signup_form'>
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
<button type="submit">Sign up</button> <button type="submit">Sign up</button>
</form> </form>
</div>
{% endblock %} {% endblock %}
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