file_name stringlengths 7 47 | file_path stringlengths 24 82 | code_content stringlengths 0 11.1k |
|---|---|---|
manage.py | django_project/manage.py | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_project.settings')
try:
from django.core.management import execute_from_command_line
exce... |
models.py | django_project/testbeds/models.py | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
class Testbed(models.Model):
device = models.TextField()
location = models.TextField()
telnet = models.TextField()
ssh = models.TextField()
notes = models.TextField(default=... |
cron.py | django_project/testbeds/cron.py | import time
from .models import Testbed
import requests
import datetime
from django.utils import timezone
from .constants import users, send_webex_message
druva='Y2lzY29zcGFyazovL3VzL1BFT1BMRS9jOWU2YjkzMi02OTMwLTQyMTktOWMzMi02MDg0NGZkYjVjZTY'
rdongare='Y2lzY29zcGFyazovL3VzL1BFT1BMRS9iZDViMjAyOC1kNjk4LTQwYjUtYTdmMC1jNz... |
constants.py | django_project/testbeds/constants.py | import requests
users = {'dpappire': ('Druva','Y2lzY29zcGFyazovL3VzL1BFT1BMRS9jOWU2YjkzMi02OTMwLTQyMTktOWMzMi02MDg0NGZkYjVjZTY'),
'rdongare': ('Rohit','Y2lzY29zcGFyazovL3VzL1BFT1BMRS9iZDViMjAyOC1kNjk4LTQwYjUtYTdmMC1jNzQzNDg3YzkxNjU'),
'shponnap': ('Shreya','Y2lzY29zcGFyazovL3VzL1BFT1BMRS9lZTE0YTVhMC1m... |
__init__.py | django_project/testbeds/__init__.py | |
apps.py | django_project/testbeds/apps.py | from django.apps import AppConfig
class TestbedsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'testbeds'
|
forms.py | django_project/testbeds/forms.py | from django import forms
from .models import Testbed
# class MyPostTestbed(forms.ModelForm):
# # template_name = 'testbeds/testbed_form.html/'
# class Meta:
# model = Testbed
# fields = ['device','location', 'telnet', 'ssh']
# OPTIONS = [
# ('sjc15', 'sjc15'),
# ('sjc16', 'sjc16'),
# ('ful', 'ful'),... |
admin.py | django_project/testbeds/admin.py | from django.contrib import admin
# Register your models here.
|
tests.py | django_project/testbeds/tests.py | from django.test import TestCase
# Create your tests here.
|
filters.py | django_project/testbeds/filters.py | import django_filters
from django import forms
from .models import Testbed
class YourModelFilter(django_filters.FilterSet):
dropdown_option1 = django_filters.ChoiceFilter(
choices=[('all', 'all'), ('free', 'free'), ('used', 'notfree')],
label='Usage',
empty_label='all',
method='filt... |
views.py | django_project/testbeds/views.py | from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.utils.decorators import method_decorator
from django.shortcuts import render, redirect, get_object_or_404
from django_filters.views import FilterView
from django.contrib import messages
from django.views im... |
0006_testbed_device_type.py | django_project/testbeds/migrations/0006_testbed_device_type.py | # Generated by Django 4.2.9 on 2024-01-26 18:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testbeds', '0005_testbed_usage_alter_testbed_location'),
]
operations = [
migrations.AddField(
model_name='testbed',
... |
0007_alter_testbed_device_type.py | django_project/testbeds/migrations/0007_alter_testbed_device_type.py | # Generated by Django 4.2.9 on 2024-01-26 19:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testbeds', '0006_testbed_device_type'),
]
operations = [
migrations.AlterField(
model_name='testbed',
name='device_t... |
0002_rename_user_testbed_testbed_uploader.py | django_project/testbeds/migrations/0002_rename_user_testbed_testbed_uploader.py | # Generated by Django 4.2.9 on 2024-01-09 22:25
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('testbeds', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='testbed',
old_name='user',
new_... |
0005_testbed_usage_alter_testbed_location.py | django_project/testbeds/migrations/0005_testbed_usage_alter_testbed_location.py | # Generated by Django 4.2.9 on 2024-01-19 20:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testbeds', '0004_alter_testbed_location'),
]
operations = [
migrations.AddField(
model_name='testbed',
name='usage',... |
0004_alter_testbed_location.py | django_project/testbeds/migrations/0004_alter_testbed_location.py | # Generated by Django 4.2.9 on 2024-01-19 20:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testbeds', '0003_testbed_notes_alter_testbed_date_posted'),
]
operations = [
migrations.AlterField(
model_name='testbed',
... |
__init__.py | django_project/testbeds/migrations/__init__.py | |
0003_testbed_notes_alter_testbed_date_posted.py | django_project/testbeds/migrations/0003_testbed_notes_alter_testbed_date_posted.py | # Generated by Django 4.2.9 on 2024-01-19 19:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('testbeds', '0002_rename_user_testbed_testbed_uploader'),
]
operations = [
migrations.AddField(
model_name='testbed',
... |
0001_initial.py | django_project/testbeds/migrations/0001_initial.py | # Generated by Django 4.2.9 on 2024-01-08 23:59
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... |
testbed-main.css | django_project/testbeds/static/testbeds/testbed-main.css | body {
background: #fafafa;
color: #333333;
margin-top: 5rem;
}
.hidden-data {
display: none;
}
.testbed-content {
background: #ffffff;
padding: 10px 20px;
border: 1px solid #dddddd;
border-radius: 3px;
margin-bottom: 20px;
}
header {
background-color: #3498db;
color: #fff... |
registration.css | django_project/testbeds/static/testbeds/registration.css | body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
max-width: 400px;
margin: 50px auto;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h2 {
text-align: center;
co... |
location-detail.html | django_project/testbeds/templates/testbeds/location-detail.html | {% extends "blog/base.html" %}
{% block content %}
{% for field in form %}
{{ field.errors }}
{% endfor %}
<form method="get">
{{ form.as_p }}
<!-- <button type="submit", name='latest' class="btn btn-outline-secondary">Latest</button>
<button type="submit", name='oldest' clas... |
testbed-detail.html | django_project/testbeds/templates/testbeds/testbed-detail.html | {% load static %}
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha38... |
testbed-delete.html | django_project/testbeds/templates/testbeds/testbed-delete.html | {% extends "blog/base.html" %}
{% block content %}
<div class="content-section">
<form method="POST">
{% csrf_token %}
<fieldset class="form-group">
<legend class="border-bottom mb-4">Delete Tested</legend>
<h2>Are you sure you want to delete Device {{... |
testbed-home.html | django_project/testbeds/templates/testbeds/testbed-home.html | {% extends "blog/base.html" %}
{% block content %}
<header>
<h1>List of Locations</h1>
</header>
<div>
{% if error_message %}
<div class="error-message">
<h5 class="error-message-display">{{ error_message }}</h5>
<a class="close-button" onclick="closeErrorMessage()"... |
testbed_form.html | django_project/testbeds/templates/testbeds/testbed_form.html | {% load static %}
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1... |
models.py | django_project/chatbot/models.py | from django.db import models
# Create your models here.
|
__init__.py | django_project/chatbot/__init__.py | |
apps.py | django_project/chatbot/apps.py | from django.apps import AppConfig
class ChatbotConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'chatbot'
|
admin.py | django_project/chatbot/admin.py | from django.contrib import admin
# Register your models here.
|
tests.py | django_project/chatbot/tests.py | from django.test import TestCase
# Create your tests here.
|
views.py | django_project/chatbot/views.py | from django.shortcuts import render
from django.http import HttpResponse
import openai
# from openai import OpenAI
# Create your views here.
client = openai.OpenAI(api_key='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')
openai_api_key = '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'
def ask_openai(me... |
__init__.py | django_project/chatbot/migrations/__init__.py | |
chatbot.css | django_project/chatbot/static/chatbot/chatbot.css | #chatbot{
margin-left: auto;
margin-right: auto;
width: 50%;
margin-top: 50px;
border-radius: 10px;
border: 1px solid green;
padding: 10px;
color: black;
background-color: cyan;
}
#userbot{
margin-left: auto;
margin-right: 0;
width: 50%;
margin-top: 50px;
border-radius: 10px;
border: 1px ... |
chatbot.html | django_project/chatbot/templates/chatbot.html | {% load static %}
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RX... |
asgi.py | django_project/django_project/asgi.py | """
ASGI config for django_project 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('DJANG... |
__init__.py | django_project/django_project/__init__.py | |
settings.py | django_project/django_project/settings.py | """
Django settings for django_project project.
Generated by 'django-admin startproject' using Django 4.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/4.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.2/ref/settings/
"""
from ... |
urls.py | django_project/django_project/urls.py | """
URL configuration for django_project project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, nam... |
wsgi.py | django_project/django_project/wsgi.py | """
WSGI config for django_project 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('DJANG... |
models.py | django_project/blog/models.py | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from django.urls import reverse
class Post(models.Model):
title = models.CharField(max_length=100)
content = models.TextField()
date_posted = models.DateTimeField(default=timezone.now)
author = models.Forei... |
__init__.py | django_project/blog/__init__.py | |
apps.py | django_project/blog/apps.py | from django.apps import AppConfig
class BlogConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'blog'
|
admin.py | django_project/blog/admin.py | from django.contrib import admin
from .models import Post
admin.site.register(Post)
|
tests.py | django_project/blog/tests.py | from django.test import TestCase
# Create your tests here.
|
urls.py | django_project/blog/urls.py | from django.urls import path
from .views import (
PostListView,
PostDetailView,
PostCreateView,
PostUpdateView,
PostDeleteView,
UserPostListView
)
from testbeds import views as testbeds_views
from chatbot import views as chatbot_views
from . import views
from users import views as users_v... |
views.py | django_project/blog/views.py | from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib.auth.models import User
from django.utils.decorators import method_decorator
from django.views.generic import (
ListView,
DetailView,
CreateView,
U... |
0002_testbedpost.py | django_project/blog/migrations/0002_testbedpost.py | # Generated by Django 4.2.9 on 2024-01-08 23:59
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('blog', '0001_initial'),
... |
__init__.py | django_project/blog/migrations/__init__.py | |
0003_delete_testbedpost.py | django_project/blog/migrations/0003_delete_testbedpost.py | # Generated by Django 4.2.9 on 2024-01-19 19:52
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_testbedpost'),
]
operations = [
migrations.DeleteModel(
name='TestbedPost',
),
]
|
0001_initial.py | django_project/blog/migrations/0001_initial.py | # Generated by Django 4.2.9 on 2024-01-06 01:31
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... |
404.css | django_project/blog/static/blog/404.css | body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
max-width: 400px;
margin: 50px auto;
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
co... |
main.css | django_project/blog/static/blog/main.css | body {
background: #fafafa;
color: #333333;
margin-top: 5rem;
}
h1, h2, h3, h4, h5, h6 {
color: #444444;
}
label.reset{
padding: 10px;
float: left;
margin-right: 15px;
}
input.reset {
padding: 10px;
margin-bottom: 16px;
margin-left: 15px;
margin-right: 15px;
border: 1px solid #ddd;
border-ra... |
post_confirm_delete.html | django_project/blog/templates/blog/post_confirm_delete.html | {% extends "blog/base.html" %}
{% block content %}
<div class="content-section">
<form method="POST">
{% csrf_token %}
<fieldset class="form-group">
<legend class="border-bottom mb-4">Delete Post</legend>
<h2>Are you sure you want to delete the post "{... |
home.html | django_project/blog/templates/blog/home.html | {% extends "blog/base.html" %}
{% block content %}
<form method='get'>
<label for="search_device"></label>
<input class="select search_blog" type="text" id="search_blog" name="search_blog" placeholder="Type your search...">
<input type="submit" name = "submitted_button" class="btn btn-primary btn-sm mt-1 mb-1" ... |
about.html | django_project/blog/templates/blog/about.html | {% extends "blog/base.html" %}
{% block content %}
<h1>About Page</h1>
{% endblock content %}
|
base.html | django_project/blog/templates/blog/base.html | {% load static %}
<!DOCTYPE html>
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.... |
post_form.html | django_project/blog/templates/blog/post_form.html | {% extends "blog/base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="content-section">
<form method="POST">
{% csrf_token %}
<fieldset class="form-group">
<legend class="border-bottom mb-4">Blog Post</legend>
{{ form|crispy }}
... |
404.html | django_project/blog/templates/blog/404.html | {% load static %}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Not Found</title>
<link rel="stylesheet" href="{% static 'css/404.css' %}">
</head>
<body>
<div class="container">
<h1>404 - Page Not Found</h1>... |
add_sidebar.html | django_project/blog/templates/blog/add_sidebar.html | |
post_detail.html | django_project/blog/templates/blog/post_detail.html | {% extends "blog/base.html" %}
{% block content %}
<article class="media content-section">
<img class="rounded-circle article-img" src="{{ object.author.profile.image.url }}">
<div class="media-body">
<div class="article-metadata">
<a class="mr-2" href="#">{{ object.author }}</a>
<small ... |
user_posts.html | django_project/blog/templates/blog/user_posts.html | {% extends "blog/base.html" %}
{% block content %}
<h1 class="mb-3">Posts by {{ view.kwargs.username }} ({{ page_obj.paginator.count }})</h1>
{% for post in posts %}
<article class="media content-section">
<img class="rounded-circle article-img" src="{{ post.author.profile.image.url }}">
... |
signals.py | django_project/users/signals.py | from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.dispatch import receiver
from .models import Profile
@receiver(post_save, sender=User)
def create_profile(sender, instance, created, **kwargs):
if created:
Profile.objects.create(user=instance)
@receiv... |
models.py | django_project/users/models.py | from django.db import models
from django.contrib.auth.models import User
from PIL import Image
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
email = models.EmailField()
bio = models.TextField(blank=True, null=True)
linkedin = models.TextField(blank=True, null=True)
im... |
constants.py | django_project/users/constants.py | import requests
import random
users = {'dpappire': ('Druva','Y2lzY29zcGFyazovL3VzL1BFT1BMRS9jOWU2YjkzMi02OTMwLTQyMTktOWMzMi02MDg0NGZkYjVjZTY'),
'rdongare': ('Rohit','Y2lzY29zcGFyazovL3VzL1BFT1BMRS9iZDViMjAyOC1kNjk4LTQwYjUtYTdmMC1jNzQzNDg3YzkxNjU'),
'shponnap': ('Shreya','Y2lzY29zcGFyazovL3VzL1BFT1BMRS... |
__init__.py | django_project/users/__init__.py | |
apps.py | django_project/users/apps.py | from django.apps import AppConfig
class UsersConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'users'
def ready(self):
import users.signals
|
forms.py | django_project/users/forms.py | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import Profile
class UserRegisterForm(UserCreationForm):
email = forms.EmailField()
class Meta:
model = User
fields = ['username', 'email', 'password1', 'password2']
clas... |
admin.py | django_project/users/admin.py | from django.contrib import admin
from .models import Profile
admin.site.register(Profile)
|
tests.py | django_project/users/tests.py | from django.test import TestCase
# Create your tests here.
|
views.py | django_project/users/views.py | from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.views.generic import UpdateView
from django.views import View
from django.contrib.auth.models import User
from django.utils.decorators import method_decorator
from .con... |
0002_profile_linkedin.py | django_project/users/migrations/0002_profile_linkedin.py | # Generated by Django 4.2.9 on 2024-01-08 05:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='profile',
name='linkedin',
fi... |
__init__.py | django_project/users/migrations/__init__.py | |
0001_initial.py | django_project/users/migrations/0001_initial.py | # Generated by Django 4.2.9 on 2024-01-08 04:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
profile.html | django_project/users/templates/users/profile.html | {% extends "blog/base.html" %}
{% load crispy_forms_tags %}
{% load widget_tweaks %}
{% block content %}
<div class="content-section">
<div class="media">
<img class="rounded-circle account-img" src="{{ user.profile.image.url }}">
<div class="media-body">
<h2 class="account-heading">... |
password_reset_done.html | django_project/users/templates/users/password_reset_done.html | {% extends "blog/base.html" %}
{% block content %}
<div class="alert alert-info">
A Code has been set to your Webex Enter it within 1 minute
</div>
<div>
<small class="text-muted">
Enter Code <a class="ml-2" href="{% url 'password_reset_confirm' %}">Reset Password?</a>
</... |
register.html | django_project/users/templates/users/register.html | {% extends "blog/base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="content-section">
<form method="POST">
{% csrf_token %}
<fieldset class="form-group">
<legend class="border-bottom mb-4">Join Today</legend>
{{ form|crispy }}
... |
password_reset.html | django_project/users/templates/users/password_reset.html | {% extends "blog/base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="content-section">
<form method="post">
{% csrf_token %}
<div>
<label class="reset" for="username">Your Username:</label>
<input class="reset" type=... |
login.html | django_project/users/templates/users/login.html | {% extends "blog/base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="content-section">
<form method="POST">
{% csrf_token %}
<fieldset class="form-group">
<legend class="border-bottom mb-4">Log In</legend>
{{ form|crispy }}
... |
password_reset_incomplete.html | django_project/users/templates/users/password_reset_incomplete.html | {% extends "blog/base.html" %}
{% block content %}
<a href="{% url 'login' %}">Back to login Page</a>
{% endblock content %} |
password_reset_confirm.html | django_project/users/templates/users/password_reset_confirm.html | {% extends "blog/base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<div class="content-section">
<form method="post">
{% csrf_token %}
<div class="form-group">
<label class="reset" for="username">Username:</label>
<input class="reset" type... |
password_reset_complete.html | django_project/users/templates/users/password_reset_complete.html | {% extends "blog/base.html" %}
{% block content %}
<div class="alert alert-info">
Your password has been set.
</div>
<a href="{% url 'login' %}">Sign In Here</a>
{% endblock content %} |
logout.html | django_project/users/templates/users/logout.html | {% extends "blog/base.html" %}
{% load crispy_forms_tags %}
{% block content %}
<h2>You have been logged out</h2>
<div class="border-top pt-3">
<small class="text-muted">
<a href="{% url 'login' %}" class="increased-font">Log In Again</a>
</small>
</div>
{% endblock content %}
|
README.md exists but content is empty.
- Downloads last month
- 6