Skip to content

IntroToDJango Pull #311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# DjangoDemo
# DjangoDemo

Hello! This work is done in preparation for an Open Source Project in cooperation with CTI and CodeDay. The overall work was done in setting up the proper environment for using a Django Web Framework.
Binary file added trydango/src/db.sqlite3
Binary file not shown.
22 changes: 22 additions & 0 deletions trydango/src/manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/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', 'trydjangoproj.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
Empty file added trydango/src/pages/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions trydango/src/pages/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 trydango/src/pages/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class PagesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'pages'
Empty file.
3 changes: 3 additions & 0 deletions trydango/src/pages/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions trydango/src/pages/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions trydango/src/pages/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
Empty file.
3 changes: 3 additions & 0 deletions trydango/src/productnew/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 trydango/src/productnew/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ProductnewConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'productnew'
24 changes: 24 additions & 0 deletions trydango/src/productnew/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 2.0.7 on 2018-07-02 22:02

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=120)),
('description', models.TextField(blank=True, null=True)),
('price', models.DecimalField(decimal_places=2, max_digits=10000)),
('summary', models.TextField()),
],
),
]
16 changes: 16 additions & 0 deletions trydango/src/productnew/migrations/0002_delete_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by Django 5.1.5 on 2025-02-06 06:51

from django.db import migrations


class Migration(migrations.Migration):

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

operations = [
migrations.DeleteModel(
name='Product',
),
]
Empty file.
9 changes: 9 additions & 0 deletions trydango/src/productnew/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.db import models

# Create your models here.
class Product(models.Model):
title = models.CharField(max_length=120)
description = models.TextField(blank=True, null=True)
price = models.DecimalField(decimal_places=2, max_digits=10000)
summary = models.TextField(blank=False, null=False) # default='whoa very cool'
featured = models.BooleanField() # null=True, default=True
3 changes: 3 additions & 0 deletions trydango/src/productnew/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions trydango/src/productnew/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
Empty file.
3 changes: 3 additions & 0 deletions trydango/src/products/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 trydango/src/products/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ProductsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'products'
Empty file.
3 changes: 3 additions & 0 deletions trydango/src/products/migrations/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 trydango/src/products/migrations/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class ProductsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'products'
8 changes: 8 additions & 0 deletions trydango/src/products/migrations/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.db import models

# Create your models here.
class Product(models.Model):
title = models.CharField(max_length=120)
description = models.TextField(blank=True, null=True)
price = models.DecimalField(decimal_places=2, max_digits=10000)
summary = models.TextField(default='whoa very cool')
3 changes: 3 additions & 0 deletions trydango/src/products/migrations/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions trydango/src/products/migrations/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
8 changes: 8 additions & 0 deletions trydango/src/products/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.db import models

# Create your models here.
class Product(models.Model):
title = models.CharField(max_length=120)
description = models.TextField(blank=True, null=True)
price = models.DecimalField(decimal_places=2, max_digits=10000)
summary = models.TextField(default='whoa very cool')
3 changes: 3 additions & 0 deletions trydango/src/products/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions trydango/src/products/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.shortcuts import render

# Create your views here.
8 changes: 8 additions & 0 deletions trydango/src/trydjango_sublime.sublime-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders":
[
{
"path": "C:\\Users\\amaya\\Dev\\trydango"
}
]
}
Loading