Skip to content
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
File renamed without changes.
Binary file added brainwave/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added brainwave/__pycache__/settings.cpython-38.pyc
Binary file not shown.
Binary file added brainwave/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added brainwave/__pycache__/wsgi.cpython-38.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions brainwave/asgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
ASGI config for brainwave project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'brainwave.settings')

application = get_asgi_application()
125 changes: 125 additions & 0 deletions brainwave/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
from pathlib import Path
import os

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-_*7_%im@0@58xl)8q^5cibhb6p^bn+788c$-_)lh*-kuf@2k(4'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []

LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/brainwave/'
LOGOUT_REDIRECT_URL = '/brainwave/'


# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'core',
'item',
'post',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'brainwave.urls'

STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'CORE', 'STATIC'),
]

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'brainwave.wsgi.application'


# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}


# Password validation
# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]


# Internationalization
# https://docs.djangoproject.com/en/4.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.2/howto/static-files/

STATIC_URL = '/static/'
MEDIA_URL = 'media/'
MEDIA_ROOT = BASE_DIR / 'media'

# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
12 changes: 12 additions & 0 deletions brainwave/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
path('', include('core.urls')),
path('items/', include('item.urls')),
path('post/', include('post.urls')),
path('admin/', admin.site.urls),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

16 changes: 16 additions & 0 deletions brainwave/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""
WSGI config for brainwave project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'brainwave.settings')

application = get_wsgi_application()
Empty file added core/__init__.py
Empty file.
Binary file added core/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added core/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added core/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file added core/__pycache__/forms.cpython-38.pyc
Binary file not shown.
Binary file added core/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added core/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added core/__pycache__/views.cpython-38.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions core/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions core/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class CoreConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'core'
40 changes: 40 additions & 0 deletions core/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from django import forms
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.contrib.auth.models import User


class LoginForm(AuthenticationForm):
username = forms.CharField(widget=forms.TextInput(attrs={
'placeholder': 'Nome de Usuário',
'class': 'w-full py-4 px-6 rounded-xl'
}))

password = forms.CharField(widget=forms.PasswordInput(attrs={
'placeholder': 'Senha',
'class': 'w-full py-4 px-6 rounded-xl'
}))

class SignupForm(UserCreationForm):
class Meta:
model = User
fields = ('username', 'email', 'password1', 'password2')

username = forms.CharField(widget=forms.TextInput(attrs={
'placeholder': 'Nome de Usuário',
'class': 'w-full py-4 px-6 rounded-xl'
}))

email = forms.CharField(widget=forms.EmailInput(attrs={
'placeholder': 'E-mail',
'class': 'w-full py-4 px-6 rounded-xl'
}))

password1 = forms.CharField(widget=forms.PasswordInput(attrs={
'placeholder': 'Senha',
'class': 'w-full py-4 px-6 rounded-xl'
}))

password2 = forms.CharField(widget=forms.PasswordInput(attrs={
'placeholder': 'Confirme senha',
'class': 'w-full py-4 px-6 rounded-xl'
}))
32 changes: 32 additions & 0 deletions core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.2.7 on 2023-11-27 05:41

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


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Thread',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=200)),
('created_at', models.DateTimeField(auto_now_add=True)),
],
),
migrations.CreateModel(
name='Post',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.TextField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('thread', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.thread')),
],
),
]
19 changes: 19 additions & 0 deletions core/migrations/0002_delete_post_delete_thread.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.7 on 2023-11-28 08:30

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('core', '0001_initial'),
]

operations = [
migrations.DeleteModel(
name='Post',
),
migrations.DeleteModel(
name='Thread',
),
]
Empty file added core/migrations/__init__.py
Empty file.
Binary file not shown.
Binary file not shown.
Binary file added core/migrations/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
4 changes: 4 additions & 0 deletions core/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from django.db import models

# Create your models here.

4 changes: 2 additions & 2 deletions css/create_post.css → core/static/css/create_post.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
padding: 20px 25px;

border-radius: 79px;
border: 0px;
border: 2px solid var(--color-black);
background-color: var(--color-blueviolet);
}

Expand All @@ -34,7 +34,7 @@
color: white;

border-radius: 79px;
border: 0px;
border: 2px solid var(--color-black);
background-color: var(--color-blueviolet);
}

Expand Down
37 changes: 37 additions & 0 deletions core/static/css/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
:root {
/* fonts */
--font-inter: Inter;
--font-inherit: inherit;
--font-arial: Arial;

/* font sizes */
--font-size-9xl: 28px;
--font-size-10xl: 29px;
--font-size-13xl: 32px;
--font-size-17xl: 36px;
--font-size-29xl: 48px;
--font-size-45xl: 64px;

/* Colors */
--color-gray-200: #1e1e1e;
--color-gray-100: #1f132f;
--color-gray-300: #0d0d0d;
--color-gray-400: #13001e;
--color-white: #fff;
--color-black: #000;
--color-blueviolet: #6b00bf;
--color-fuchsia: #ee00ff;

/* Gaps */
--gap-6xl: 25px;

/* Paddings */
--padding-18xl: 37px;
--padding-20xl: 39px;

/* Border radiuses */
--br-41xl: 60px;
--br-60xl: 79px;
--br-lgi: 19px;
--br-3xs: 10px;
}
26 changes: 24 additions & 2 deletions css/index.css → core/static/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ body {
font-size: var(--font-size-13xl);
justify-self: center;
align-self: center;


}

.login_icon{
Expand Down Expand Up @@ -233,3 +231,27 @@ body {
appearance: none;
background-color: inherit;
}

.dropdown {
text-decoration: none;
color: inherit;
}

.dropdown-menu{
width: 150px;
position: absolute;
box-shadow: 0 0 5px #ee00ff;
display: none;
border-radius: 5px;
background-color: #0d0c0c;
}

.dropdown-menu a{
display: block;
color: #ee00ff;
}

.dropdown:hover .dropdown-menu{
display: block;
}

Loading