Skip to content

Commit a46ba0e

Browse files
committed
Alpha version UP
0 parents  commit a46ba0e

File tree

696 files changed

+123488
-0
lines changed

Some content is hidden

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

696 files changed

+123488
-0
lines changed

coding_app/__init__.py

Whitespace-only changes.
162 Bytes
Binary file not shown.
3.02 KB
Binary file not shown.
1.27 KB
Binary file not shown.
656 Bytes
Binary file not shown.

coding_app/asgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for coding_app project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'coding_app.settings')
15+
16+
application = get_asgi_application()

coding_app/settings.py

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
"""
2+
Django settings for coding_app project.
3+
4+
Generated by 'django-admin startproject' using Django 5.1.4.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/5.1/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/5.1/ref/settings/
11+
"""
12+
13+
from pathlib import Path
14+
import os
15+
16+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
17+
BASE_DIR = Path(__file__).resolve().parent.parent
18+
19+
20+
# Quick-start development settings - unsuitable for production
21+
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
22+
23+
# SECURITY WARNING: keep the secret key used in production secret!
24+
SECRET_KEY = 'django-insecure-s@a9-er^d%*iug4)#)wy50$fn$wj5-5q(31%3))$3khk99r3d4'
25+
26+
# SECURITY WARNING: don't run with debug turned on in production!
27+
DEBUG = True
28+
29+
ALLOWED_HOSTS = ['*']
30+
31+
CSRF_TRUSTED_ORIGINS = ['http://116.213.35.22:8016']
32+
33+
34+
# Application definition
35+
36+
INSTALLED_APPS = [
37+
'django.contrib.admin',
38+
'django.contrib.auth',
39+
'django.contrib.contenttypes',
40+
'django.contrib.sessions',
41+
'django.contrib.messages',
42+
'django.contrib.staticfiles',
43+
'pages',
44+
'core',
45+
'questions',
46+
'user_panel'
47+
]
48+
49+
MIDDLEWARE = [
50+
'django.middleware.security.SecurityMiddleware',
51+
'django.contrib.sessions.middleware.SessionMiddleware',
52+
'django.middleware.common.CommonMiddleware',
53+
'django.middleware.csrf.CsrfViewMiddleware',
54+
'django.contrib.auth.middleware.AuthenticationMiddleware',
55+
'django.contrib.messages.middleware.MessageMiddleware',
56+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
57+
]
58+
59+
ROOT_URLCONF = 'coding_app.urls'
60+
61+
TEMPLATES = [
62+
{
63+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
64+
'DIRS': [os.path.join(BASE_DIR, 'templates')],
65+
'APP_DIRS': True,
66+
'OPTIONS': {
67+
'context_processors': [
68+
'django.template.context_processors.debug',
69+
'django.template.context_processors.request',
70+
'django.contrib.auth.context_processors.auth',
71+
'django.contrib.messages.context_processors.messages',
72+
],
73+
},
74+
},
75+
]
76+
77+
WSGI_APPLICATION = 'coding_app.wsgi.application'
78+
79+
80+
# Database
81+
# https://docs.djangoproject.com/en/5.1/ref/settings/#databases
82+
83+
DATABASES = {
84+
# 'default': {
85+
# 'ENGINE': 'django.db.backends.sqlite3',
86+
# 'NAME': BASE_DIR / 'db.sqlite3',
87+
# }
88+
'default': {
89+
'ENGINE': 'django.db.backends.postgresql',
90+
'NAME': 'rvcodehubdb', # Database name
91+
'USER': 'rvcodehub_user', # Database user
92+
'PASSWORD': 'helloMERL', # Database password
93+
'HOST': 'localhost', # Set to 'localhost' or your server IP
94+
'PORT': '5433', # Default PostgreSQL port
95+
}
96+
}
97+
98+
99+
# Password validation
100+
# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators
101+
102+
AUTH_PASSWORD_VALIDATORS = [
103+
{
104+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
105+
},
106+
{
107+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
108+
},
109+
{
110+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
111+
},
112+
{
113+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
114+
},
115+
]
116+
117+
118+
# Internationalization
119+
# https://docs.djangoproject.com/en/5.1/topics/i18n/
120+
121+
LANGUAGE_CODE = 'en-us'
122+
123+
TIME_ZONE = 'UTC'
124+
125+
USE_I18N = True
126+
127+
USE_TZ = True
128+
129+
130+
# Static files (CSS, JavaScript, Images)
131+
# https://docs.djangoproject.com/en/5.1/howto/static-files/
132+
133+
STATIC_URL = 'rvcodehub/static/'
134+
135+
# Default primary key field type
136+
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field
137+
138+
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
139+
140+
STATICFILES_DIRS = [
141+
os.path.join(BASE_DIR, 'static')
142+
]
143+
144+
LOGIN_REDIRECT_URL = 'pages:home'
145+
LOGOUT_REDIRECT_URL = 'user_panel:login_view'
146+
LOGIN_URL = 'user_panel:login_view'

coding_app/urls.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""
2+
URL configuration for coding_app project.
3+
4+
The `urlpatterns` list routes URLs to views. For more information please see:
5+
https://docs.djangoproject.com/en/5.1/topics/http/urls/
6+
Examples:
7+
Function views
8+
1. Add an import: from my_app import views
9+
2. Add a URL to urlpatterns: path('', views.home, name='home')
10+
Class-based views
11+
1. Add an import: from other_app.views import Home
12+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13+
Including another URLconf
14+
1. Import the include() function: from django.urls import include, path
15+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16+
"""
17+
from django.contrib import admin
18+
from django.urls import path, include
19+
20+
urlpatterns = [
21+
path('rvcodehub/admin/', admin.site.urls),
22+
path('rvcodehub/', include('pages.urls')),
23+
path('rvcodehub/questions/', include('questions.urls')),
24+
path('rvcodehub/user_panel/', include('user_panel.urls')),
25+
]

coding_app/wsgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for coding_app project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'coding_app.settings')
15+
16+
application = get_wsgi_application()

core/__init__.py

Whitespace-only changes.
156 Bytes
Binary file not shown.
336 Bytes
Binary file not shown.

core/__pycache__/apps.cpython-312.pyc

458 Bytes
Binary file not shown.
651 Bytes
Binary file not shown.

core/admin.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.contrib import admin
2+
from .models import Languages
3+
# Register your models here.
4+
5+
admin.site.register(Languages)

core/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class CoreConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'core'

core/migrations/0001_initial.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 5.1.4 on 2025-01-07 11:40
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='Languages',
16+
fields=[
17+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('name', models.CharField(max_length=100)),
19+
],
20+
),
21+
]

core/migrations/__init__.py

Whitespace-only changes.
Binary file not shown.
Binary file not shown.

core/models.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from django.db import models
2+
3+
# Create your models here.
4+
5+
class Languages(models.Model):
6+
name = models.CharField(max_length=100)
7+
8+
def __str__(self):
9+
return self.name

core/tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

core/views.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

db.sqlite3

176 KB
Binary file not shown.

manage.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
3+
import os
4+
import sys
5+
6+
7+
def main():
8+
"""Run administrative tasks."""
9+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'coding_app.settings')
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
19+
20+
21+
if __name__ == '__main__':
22+
main()

pages/__init__.py

Whitespace-only changes.
157 Bytes
Binary file not shown.
621 Bytes
Binary file not shown.
461 Bytes
Binary file not shown.
1.19 KB
Binary file not shown.
399 Bytes
Binary file not shown.
1.85 KB
Binary file not shown.

pages/admin.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# from django.contrib import admin
2+
# from .models import *
3+
# # Register your models here.
4+
5+
# admin.site.register(BugReport)
6+
7+
8+
from django.contrib import admin
9+
10+
from .models import BugReport
11+
12+
13+
14+
15+
class BugReportAdmin(admin.ModelAdmin):
16+
17+
list_display = ('name', 'email', 'severity', 'created_at')
18+
19+
20+
21+
admin.site.register(BugReport, BugReportAdmin)

pages/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class PagesConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'pages'

pages/migrations/0001_initial.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 5.1.4 on 2025-01-08 20:12
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='BugReport',
16+
fields=[
17+
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('name', models.CharField(max_length=100)),
19+
('email', models.EmailField(max_length=254)),
20+
('bug_description', models.TextField()),
21+
('steps_to_reproduce', models.TextField()),
22+
('severity', models.CharField(choices=[('low', 'Low'), ('medium', 'Medium'), ('high', 'High'), ('critical', 'Critical')], max_length=10)),
23+
('created_at', models.DateTimeField(auto_now_add=True)),
24+
],
25+
),
26+
]

pages/migrations/__init__.py

Whitespace-only changes.
Binary file not shown.
Binary file not shown.

pages/models.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from django.db import models
2+
3+
# Create your models here.
4+
class BugReport(models.Model):
5+
SEVERITY_CHOICES = [
6+
('low', 'Low'),
7+
('medium', 'Medium'),
8+
('high', 'High'),
9+
('critical', 'Critical'),
10+
]
11+
12+
name = models.CharField(max_length=100)
13+
email = models.EmailField()
14+
bug_description = models.TextField()
15+
steps_to_reproduce = models.TextField()
16+
severity = models.CharField(max_length=10, choices=SEVERITY_CHOICES)
17+
created_at = models.DateTimeField(auto_now_add=True)
18+
19+
def __str__(self):
20+
return f"{self.name} - {self.severity}"

pages/tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

pages/urls.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from django.urls import path
2+
from .views import *
3+
4+
app_name = 'pages'
5+
6+
urlpatterns = [
7+
path('', home_view, name='home'),
8+
path('bug_report/', bug_report, name='bug_report'),
9+
]

0 commit comments

Comments
 (0)