diff --git a/c++ graphics/Basic Graphic Programming in C++ 16e929a92d1c44e58fd51cd6fbff099f.md b/c++ graphics/Basic Graphic Programming in C++ 16e929a92d1c44e58fd51cd6fbff099f.md new file mode 100644 index 0000000..d76a897 --- /dev/null +++ b/c++ graphics/Basic Graphic Programming in C++ 16e929a92d1c44e58fd51cd6fbff099f.md @@ -0,0 +1,87 @@ +# Basic Graphic Programming in C++ + + + +### What is graphics.h exactly? + +**graphics.h** library is used to include and facilitate graphical operations in program. graphics.h functions can be used to draw different shapes, display text in different fonts, change colors and many more. Using functions of graphics.h you can make graphics programs, animations, projects and games. You can draw circles, lines, rectangles, bars and many other geometrical figures. You can change their colors using the available functions and fill them. + +### **As mentioned earlier the header file “graphics.h” contains functions which some of them are described below:** + +- `int initwindow (int width, int height, const char* title, int left, int top)` + + In order to generate a Viewport or a window for drawing graphics shapes, we should use a function called initwindow() + + - **int width:** width of the created window in pixels (integer type) + - **int height:** height of the created window in pixels (integer type) + - **const char* title: t**he title of the generated window which is a string type with dynamic and fixed memory allocation + - **int left:** the horizontal (X) position of the window on the screen (integer type) + - **int top:** the longitudinal (Y) position of the window on the screen (integer type) + + `initwindow (400 ,400, "Viewport" ,300 ,200);` + +- `putpixel(int x, int y)` + + This function is used to draw a dot in (x, y) position. + +- `line(int x1, int y1, int x2, int y2);` + + Line function is used to draw a line from a point (x1, y1) to point (x2, y2). (x1, y1) and (x2, y2) are end points of the line. + +- `circle(int x, int y, int radius);` + + Circle function is used to draw a circle with center (x, y) and radius specified in the third parameter. + +- `rectangle (int left, int top, int right, int bottom);` + + To create a rectangle, you have to pass the four parameters in this function. The two parameters represent the left and top upper left corner. Similarly, the right bottom parameter represents the lower right corner of the rectangle. + +- `outtextxy(int x, int y, char *string);` + + This function displays the text or string at a specified point (x, y) on the screen. + . + +- `setcolor(int color);` + + setcolor sets the current drawing color to a new color. In graphics, each color is assigned a number. Total number of colors available are 16. Number of available colors depends on current graphics mode and driver. For example, setcolor(RED) or setcolor(4) changes the current drawing color to RED. (default drawing color is WHITE) The Colors table is given below: + + | Color | Int values | + | --- | --- | + | BLACK | 0 | + | BLUE | 1 | + | GREEN | 2 | + | CYAN | 3 | + | RED | 4 | + | MAGENTA | 5 | + | BROWN | 6 | + | LIGHTGRAY | 7 | + | DARKGRAY | 8 | + | LIGHTBLUE | 9 | + | LIGHTGREEN | 10 | + | LIGHTCYAN | 11 | + | LIGHRED | 12 | + | LIGHTMAGENTA | 13 | + | YELLOW | 14 | + | WHITE | 15 | +- `setfillstyle(int pattern, int color);` + + This ****function sets the current fill pattern and fill color. The table of colors has already mentioned; below is the table showing INT VALUES corresponding to Patterns: + + | Pattern | Int values | + | --- | --- | + | EMPTY_FILL | 0 | + | SOLID_FILL | 1 | + | LINE_FILL | 2 | + | LTSLASH_FILL | 3 | + | SLASH_FILL | 4 | + | BKSLASH_FILL | 5 | + | LTBKSLASH_FILL | 6 | + | HATCH_FILL | 7 | + | XHATCH_FILL | 8 | + | INTERLEAVE_FILL | 9 | + | WIDE_DOT_FILL | 10 | + | CLOSE_DOT_FILL | 11 | + | USER_FILL | 12 | \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/__init__.py b/django_practiceEnglish_app/PracticeEnglish/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/__init__.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..f6730a9 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/__init__.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/admin.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000..6f931dc Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/admin.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/apps.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000..8e3fa6b Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/apps.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/models.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000..155d517 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/models.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/urls.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000..63f34c5 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/urls.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/__pycache__/views.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000..891a55f Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/__pycache__/views.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/admin.py b/django_practiceEnglish_app/PracticeEnglish/admin.py new file mode 100644 index 0000000..7bc1085 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/admin.py @@ -0,0 +1,13 @@ +from django.contrib import admin +from .models import * +admin.site.register(example) +admin.site.register(verb_court) +admin.site.register(verb_restaurant) +admin.site.register(verb_airport) +admin.site.register(verb_hotel) +admin.site.register(phrase_say) +admin.site.register(phrase_off) +admin.site.register(phrase_afraid) +admin.site.register(new_thing_me_too) +admin.site.register(new_thing_ithink) +admin.site.register(new_thing_very) diff --git a/django_practiceEnglish_app/PracticeEnglish/apps.py b/django_practiceEnglish_app/PracticeEnglish/apps.py new file mode 100644 index 0000000..ff48670 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class PracticeenglishConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'PracticeEnglish' diff --git a/django_practiceEnglish_app/PracticeEnglish/form.py b/django_practiceEnglish_app/PracticeEnglish/form.py new file mode 100644 index 0000000..97f8439 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/form.py @@ -0,0 +1,10 @@ +# from django.forms import ModelForm +# from django import forms +# from .models import * + +# class uoload_verb_court(ModelForm): +# verb=forms.TextInput() +# meaning=forms.TextInput() +# class Meta: +# model=verb_court +# fields=["verb", "meaning"] \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/0001_initial.py b/django_practiceEnglish_app/PracticeEnglish/migrations/0001_initial.py new file mode 100644 index 0000000..e6592aa --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/migrations/0001_initial.py @@ -0,0 +1,95 @@ +# Generated by Django 4.1.3 on 2022-11-23 07:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='example', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ('example', models.CharField(max_length=500)), + ], + ), + migrations.CreateModel( + name='new_thing_ithink', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('new', models.CharField(max_length=30)), + ('example', models.CharField(max_length=60)), + ], + ), + migrations.CreateModel( + name='new_thing_me_too', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('new', models.CharField(max_length=30)), + ('example', models.CharField(max_length=60)), + ], + ), + migrations.CreateModel( + name='phrase_afraid', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('phrase', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='phrase_off', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('phrase', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='phrase_say', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('phrase', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='verb_airport', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('verb', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='verb_court', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('verb', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + migrations.CreateModel( + name='verb_hotel', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('verb', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=60)), + ], + ), + migrations.CreateModel( + name='verb_restaurant', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('verb', models.CharField(max_length=30)), + ('meaning', models.CharField(max_length=30)), + ], + ), + ] diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/0002_remove_new_thing_ithink_example.py b/django_practiceEnglish_app/PracticeEnglish/migrations/0002_remove_new_thing_ithink_example.py new file mode 100644 index 0000000..39e8b98 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/migrations/0002_remove_new_thing_ithink_example.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.3 on 2022-11-23 10:07 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('PracticeEnglish', '0001_initial'), + ] + + operations = [ + migrations.RemoveField( + model_name='new_thing_ithink', + name='example', + ), + ] diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/0003_new_thing_very.py b/django_practiceEnglish_app/PracticeEnglish/migrations/0003_new_thing_very.py new file mode 100644 index 0000000..f0bfe6d --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/migrations/0003_new_thing_very.py @@ -0,0 +1,21 @@ +# Generated by Django 4.1.3 on 2022-11-23 10:18 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('PracticeEnglish', '0002_remove_new_thing_ithink_example'), + ] + + operations = [ + migrations.CreateModel( + name='new_thing_very', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('new', models.CharField(max_length=30)), + ('example', models.CharField(max_length=60)), + ], + ), + ] diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__init__.py b/django_practiceEnglish_app/PracticeEnglish/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0001_initial.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0001_initial.cpython-310.pyc new file mode 100644 index 0000000..13da55f Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0001_initial.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0002_remove_new_thing_ithink_example.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0002_remove_new_thing_ithink_example.cpython-310.pyc new file mode 100644 index 0000000..9b4ac91 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0002_remove_new_thing_ithink_example.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0003_new_thing_very.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0003_new_thing_very.cpython-310.pyc new file mode 100644 index 0000000..cbf7624 Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/0003_new_thing_very.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/__init__.cpython-310.pyc b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..e90082c Binary files /dev/null and b/django_practiceEnglish_app/PracticeEnglish/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/PracticeEnglish/models.py b/django_practiceEnglish_app/PracticeEnglish/models.py new file mode 100644 index 0000000..719cbd0 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/models.py @@ -0,0 +1,83 @@ +from django.db import models + +class example(models.Model): + name = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + example = models.CharField(max_length=500) + + def __str__ (self): + return self.name + +class phrase_say(models.Model): + phrase = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.phrase +class phrase_off(models.Model): + phrase = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.phrase +class phrase_afraid(models.Model): + phrase = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.phrase + +class verb_court(models.Model): + verb = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.verb +class verb_restaurant(models.Model): + verb = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.verb +class verb_airport(models.Model): + verb = models.CharField(max_length=30) + meaning = models.CharField(max_length=30) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.verb +class verb_hotel(models.Model): + verb = models.CharField(max_length=30) + meaning = models.CharField(max_length=60) + #example = models.CharField(max_length=500) + + def __str__ (self): + return self.verb + + +class new_thing_me_too(models.Model): + new = models.CharField(max_length=30) + example = models.CharField(max_length=60) + # instead = models.CharField(max_length=1000) + + def __str__ (self): + return self.new +class new_thing_ithink(models.Model): + new = models.CharField(max_length=30) + # example = models.CharField(max_length=60) + # instead = models.CharField(max_length=1000) + + def __str__ (self): + return self.new +class new_thing_very(models.Model): + new = models.CharField(max_length=30) + example = models.CharField(max_length=60) + # instead = models.CharField(max_length=1000) + + def __str__ (self): + return self.new \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/static/PracticeEnglish/main.css b/django_practiceEnglish_app/PracticeEnglish/static/PracticeEnglish/main.css new file mode 100644 index 0000000..7a62d6a --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/static/PracticeEnglish/main.css @@ -0,0 +1,84 @@ +body { + background: #1b1b1b; + color: #333333; + margin-top: 5rem; + } + + h1, h2, h3, h4, h5, h6 { + color: #444444; + } + + ul { + margin: 0; + } + + .bg-steel { + background-color: #5f788a; + } + + .site-header .navbar-nav .nav-link { + color: #323232; + } + + .site-header .navbar-nav .nav-link:hover { + color: #1b1b1b; + } + + .site-header .navbar-nav .nav-link.active { + font-weight: 500; + } + + .content-section { + background: #1b1b1b; + padding: 10px 20px; + border: 1px solid #323232; + border-radius: 3px; + margin-bottom: 20px; + } + + .article-title { + color: #444444; + } + + a.article-title:hover { + color: #428bca; + text-decoration: none; + } + + .article-content { + white-space: pre-line; + } + + .article-img { + height: 65px; + width: 65px; + margin-right: 16px; + } + + .article-metadata { + padding-bottom: 1px; + margin-bottom: 4px; + border-bottom: 1px solid #323232 + } + + .article-metadata a:hover { + color: #333; + text-decoration: none; + } + + .article-svg { + width: 25px; + height: 25px; + vertical-align: middle; + } + + .account-img { + height: 125px; + width: 125px; + margin-right: 20px; + margin-bottom: 16px; + } + + .account-heading { + font-size: 2.5rem; + } \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/base.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/base.html new file mode 100644 index 0000000..26ecc68 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/base.html @@ -0,0 +1,71 @@ + + + + + + + + + + + + +{% if messages %} + {% for message in messages %} +
+ {{message}} +
+ {% endfor %} +{% endif %} +{% block content %} +{% endblock content %} + + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_new_thing_group.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_new_thing_group.html new file mode 100644 index 0000000..315c821 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_new_thing_group.html @@ -0,0 +1,86 @@ + + + + + +

Stop saying ...

+ Me too +

paragraph

+ I think +

paragraph

+ Very + + \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_phrase_group.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_phrase_group.html new file mode 100644 index 0000000..08d70e6 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_phrase_group.html @@ -0,0 +1,147 @@ + + + + + + + + + + + Phrases with "say" + + + + + + + Phrases with "off" + + + + + + + Phrases with "afraid" + + + + \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_verb_group.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_verb_group.html new file mode 100644 index 0000000..41e7ec8 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/choose_verb_group.html @@ -0,0 +1,326 @@ + + + + + +
+ + +
+
+
+
+
+
+ Restaurant +
+ + +
+
+
+
+
+
+ Airport +
+ + +
+
+
+
+
+
+ Hotel +
+ + +
+
+
+
+
+
+ Court +
+ +
+ + \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/example.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/example.html new file mode 100644 index 0000000..3847db8 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/example.html @@ -0,0 +1,182 @@ + + + + + + + + + +
Court
+ + + + + + + + + + + + + + {% for example in examples %} + + + + {% endfor %} + + + +
#VerbMeaningExample
1 + {{ example.name }} + + + + + + + + +

Stop saying "Me too" ; use these instead...

+ + + + + + + + + + + + + {% for new_thing_me_too in new_things_me_too %} + + + + + + + + {% endfor %} + + + +
#SuggestionExample
+ # + + {{ new_thing_me_too.new }} + + {{ new_thing_me_too.example }} +
+ + + {{ example.meaning }} +
+ {{ example.example }} +
+ \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/favourite.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/favourite.html new file mode 100644 index 0000000..e69de29 diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things.html new file mode 100644 index 0000000..bf0e7be --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + + {% for new in news %} + + + + + + {% endfor %} + +
Don't sayMeaningsay these instead!
+ {{ new.new }} + + {{ new.meaning }} + + {{ new.instead }} +
+ + + \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things_ithink.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things_ithink.html new file mode 100644 index 0000000..6eb76c6 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things_ithink.html @@ -0,0 +1,141 @@ + + + + + + + + + + +

Stop saying "I think"; say these instead!

+ + + + + + + + + + + + {% for new_thing_ithink in new_things_ithink %} + + + + + {% endfor %} + + + + +
Suggestion
+ {{ new_thing_ithink.new }} +
+ + + + + + + + + + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things_me_too.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things_me_too.html new file mode 100644 index 0000000..b6f8d7d --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things_me_too.html @@ -0,0 +1,135 @@ + + + + + + + + + + +

Stop saying "me too"; say these instead!

+ + + + + + + + + + + + {% for new_thing_me_too in new_things_me_too %} + + + + + + + {% endfor %} + + + + +
SuggestionExample
+ {{ new_thing_me_too.new }} + + {{ new_thing_me_too.example }} +
+ + +
{% csrf_token %} + + + +
+ + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things_very.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things_very.html new file mode 100644 index 0000000..68777c7 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/new_things_very.html @@ -0,0 +1,136 @@ + + + + + + + + + + +

Stop saying "very"; say these instead!

+ + + + + + + + + + + + {% for new_thing_very in new_things_very %} + + + + + + + {% endfor %} + + + + +
SuggestionExample
+ {{ new_thing_very.new }} + + {{ new_thing_very.example }} +
+ + +
{% csrf_token %} + + + +
+ + + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases.html new file mode 100644 index 0000000..e348ff9 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases.html @@ -0,0 +1,30 @@ + + + + + + + + + + + + + {% for phrase in phrases %} + + + + + + {% endfor %} + +
PhraseMeaningExample
+ {{ phrase.phrase }} + + {{ phrase.meaning }} + + {{ phrase.example }} +
+ + + \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases_afraid.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases_afraid.html new file mode 100644 index 0000000..3a728b7 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases_afraid.html @@ -0,0 +1,136 @@ + + + + + + + + + + +

Phrase with afraid

+ + + + + + + + + + + + + {% for phrase_afraid in phrases_afraid %} + + + + + + + {% endfor %} + + + + +
PhraseMeaning
+ {{ phrase_afraid.phrase }} + + {{ phrase_afraid.meaning }} +
+ + +
{% csrf_token %} + + + +
+ + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases_off.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases_off.html new file mode 100644 index 0000000..a59e7d3 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases_off.html @@ -0,0 +1,136 @@ + + + + + + + + + + +

Phrase with off

+ + + + + + + + + + + + {% for phrase_off in phrases_off %} + + + + + + + {% endfor %} + + + + + +
PhraseMeaning
+ {{ phrase_off.phrase }} + + {{ phrase_off.meaning }} +
+ + +
{% csrf_token %} + + + +
+ + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases_say.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases_say.html new file mode 100644 index 0000000..ff3269b --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/phrases_say.html @@ -0,0 +1,137 @@ + + + + + + + + + + +

Phrase with say

+ + + + + + + + + + + + + {% for phrase_say in phrases_say %} + + + + + + + {% endfor %} + + + + + +
PhraseMeaning
+ {{ phrase_say.phrase }} + + {{ phrase_say.meaning }} +
+ + +
{% csrf_token %} + + + +
+ + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_airport.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_airport.html new file mode 100644 index 0000000..0327655 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_airport.html @@ -0,0 +1,148 @@ + + + + + + + + + + + +

Words related to airport

+ + + + + + + + + + + + + {% for verb_airport in verbs_airport %} + + + + + + + + + {% endfor %} + + +
VerbMeaning
+ {{ verb_airport.verb }} + + {{ verb_airport.meaning }} + + + + +
+ + +
{% csrf_token %} + + + +
+ + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_court.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_court.html new file mode 100644 index 0000000..36ccf60 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_court.html @@ -0,0 +1,134 @@ + + + + + + + + + + +

Words related to court

+ + + + + + + + + + + {% for verb_court in verbs_court %} + + + + + + + {% endfor %} + + + +
VerbMeaning
+ {{ verb_court.verb }} + + {{ verb_court.meaning }} +
+ + +
{% csrf_token %} + + + +
+ + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_hotel.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_hotel.html new file mode 100644 index 0000000..881e360 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_hotel.html @@ -0,0 +1,134 @@ + + + + + + + + + + +

Words related to hotel

+ + + + + + + + + + + {% for verb_hotel in verbs_hotel %} + + + + + + + {% endfor %} + + + + +
VerbMeaning
+ {{ verb_hotel.verb }} + + {{ verb_hotel.meaning }} +
+ + +
{% csrf_token %} + + + +
+ + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_restaurant.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_restaurant.html new file mode 100644 index 0000000..c44b3c0 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/verbs_restaurant.html @@ -0,0 +1,134 @@ + + + + + + + + + + +

Words related to restaurant

+ + + + + + + + + + + {% for verb_restaurant in verbs_restaurant %} + + + + + + + {% endfor %} + + + + +
VerbMeaning
+ {{ verb_restaurant.verb }} + + {{ verb_restaurant.meaning }} +
+ + +
{% csrf_token %} + + + +
+ + diff --git a/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/welcome.html b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/welcome.html new file mode 100644 index 0000000..85c5e18 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/templates/PracticeEnglish/welcome.html @@ -0,0 +1,186 @@ +{% extends 'PracticeEnglish/base.html' %} +{% block content %} + + + + +
+ + +
+
+
+

01

+

Learn more phrases

+
+

Focus on learning more phrases with their meaning.

+ Let's go +
+
+
+ +
+
+
+

02

+

Learn more verbs

+
+

Focus on learning more verbs with their meaning.

+ + Let's go +
+
+
+
+
+
+

03

+

Don't be repetitive and learn new things!

+

Focus on learning some new phrases for a meaning that you may don't know them.

+ Let's go +
+
+
+
+ +{% endblock content %} diff --git a/django_practiceEnglish_app/PracticeEnglish/tests.py b/django_practiceEnglish_app/PracticeEnglish/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/django_practiceEnglish_app/PracticeEnglish/urls.py b/django_practiceEnglish_app/PracticeEnglish/urls.py new file mode 100644 index 0000000..c1c99d3 --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/urls.py @@ -0,0 +1,26 @@ +from django.urls import path +from . import views +urlpatterns=[ + path('' , views.welcome, name= 'welcome'), + path('example_learning/' , views.example_learning, name= 'example_learning'), + + + path('choose_verb_group/' , views.choose_verb_group, name= 'choose_verb_group'), + path('choose_phrase_group/' , views.choose_phrase_group, name= 'choose_phrase_group'), + path('choose_new_thing_group/' , views.choose_new_thing_group, name= 'choose_new_thing_group'), + + + + path('verbs_court' , views.verbs_court, name= 'verbs_court'), + path('verbs_restaurant' , views.verbs_restaurant, name= 'verbs_restaurant'), + path('verbs_airport' , views.verbs_airport, name= 'verbs_airport'), + path('verbs_hotel' , views.verbs_hotel, name= 'verbs_hotel'), + + path('phrases_say' , views.phrases_say, name= 'phrases_say'), + path('phrases_off' , views.phrases_off, name= 'phrases_off'), + path('phrases_afraid' , views.phrases_afraid, name= 'phrases_afraid'), + + path('new_things_me_too' , views.new_things_me_too, name= 'new_things_me_too'), + path('new_things_ithink' , views.new_things_ithink, name= 'new_things_ithink'), + path('new_things_very' , views.new_things_very, name= 'new_things_very'), +] \ No newline at end of file diff --git a/django_practiceEnglish_app/PracticeEnglish/views.py b/django_practiceEnglish_app/PracticeEnglish/views.py new file mode 100644 index 0000000..9fac34d --- /dev/null +++ b/django_practiceEnglish_app/PracticeEnglish/views.py @@ -0,0 +1,116 @@ +from django.shortcuts import render +from django.http import HttpResponse +from .models import * + +from django.contrib.auth.forms import UserCreationForm + + +def welcome(request): + return render(request, 'PracticeEnglish/welcome.html' ) + +def example_learning(request): + context ={ + 'examples' : example.objects.all() + } + return render(request, 'PracticeEnglish/example.html', context) + + +def verbs_court(request): + if request.method == "POST": + form = request.POST + verb_court.objects.create(verb = form["verb"],meaning = form["meaning"]) + + context ={ + 'verbs_court' : verb_court.objects.all() + } + return render(request, 'PracticeEnglish/verbs_court.html', context) +def verbs_restaurant(request): + if request.method == "POST": + form = request.POST + verb_restaurant.objects.create(verb = form["verb"],meaning = form["meaning"]) + + context ={ + 'verbs_restaurant' : verb_restaurant.objects.all() + } + return render(request, 'PracticeEnglish/verbs_restaurant.html', context) +def verbs_airport(request): + if request.method == "POST": + form = request.POST + verb_airport.objects.create(verb = form["verb"],meaning = form["meaning"]) + + context ={ + 'verbs_airport' : verb_airport.objects.all() + } + return render(request, 'PracticeEnglish/verbs_airport.html', context) +def verbs_hotel(request): + if request.method == "POST": + form = request.POST + verb_hotel.objects.create(verb = form["verb"],meaning = form["meaning"]) + + context ={ + 'verbs_hotel' : verb_hotel.objects.all() + } + return render(request, 'PracticeEnglish/verbs_hotel.html', context) + +def phrases_say(request): + if request.method == "POST": + form = request.POST + phrase_say.objects.create(phrase = form["phrase"],meaning = form["meaning"]) + + context ={ + 'phrases_say' : phrase_say.objects.all() + } + return render(request, 'PracticeEnglish/phrases_say.html', context) +def phrases_off(request): + if request.method == "POST": + form = request.POST + phrase_off.objects.create(phrase = form["phrase"],meaning = form["meaning"]) + + context ={ + 'phrases_off' : phrase_off.objects.all() + } + return render(request, 'PracticeEnglish/phrases_off.html', context) +def phrases_afraid(request): + if request.method == "POST": + form = request.POST + phrase_afraid.objects.create(phrase = form["phrase"],meaning = form["meaning"]) + + context ={ + 'phrases_afraid' : phrase_afraid.objects.all() + } + return render(request, 'PracticeEnglish/phrases_afraid.html', context) + +def new_things_me_too(request): + if request.method == "POST": + form = request.POST + new_thing_me_too.objects.create(new = form["new"], example = form["example"]) + + context ={ + 'new_things_me_too' : new_thing_me_too.objects.all() + } + return render(request, 'PracticeEnglish/new_things_me_too.html', context) +def new_things_ithink(request): + if request.method == "POST": + form = request.POST + new_thing_ithink.objects.create(new = form["new"], example = form["example"]) + + context ={ + 'new_things_ithink' : new_thing_ithink.objects.all() + } + return render(request, 'PracticeEnglish/new_things_ithink.html', context) +def new_things_very(request): + if request.method == "POST": + form = request.POST + new_thing_very.objects.create(new = form["new"], example = form["example"]) + + context ={ + 'new_things_very' : new_thing_very.objects.all() + } + return render(request, 'PracticeEnglish/new_things_very.html', context) + +def choose_new_thing_group(request): + return render(request, 'PracticeEnglish/choose_new_thing_group.html') +def choose_verb_group(request): + return render(request, 'PracticeEnglish/choose_verb_group.html') +def choose_phrase_group(request): + return render(request, 'PracticeEnglish/choose_phrase_group.html') diff --git a/django_practiceEnglish_app/db.sqlite3 b/django_practiceEnglish_app/db.sqlite3 new file mode 100644 index 0000000..a597805 Binary files /dev/null and b/django_practiceEnglish_app/db.sqlite3 differ diff --git a/django_practiceEnglish_app/manage.py b/django_practiceEnglish_app/manage.py new file mode 100644 index 0000000..a7da667 --- /dev/null +++ b/django_practiceEnglish_app/manage.py @@ -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', 'mysite.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() diff --git a/django_practiceEnglish_app/mysite/__init__.py b/django_practiceEnglish_app/mysite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_practiceEnglish_app/mysite/__pycache__/__init__.cpython-310.pyc b/django_practiceEnglish_app/mysite/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..ebd165a Binary files /dev/null and b/django_practiceEnglish_app/mysite/__pycache__/__init__.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/mysite/__pycache__/settings.cpython-310.pyc b/django_practiceEnglish_app/mysite/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000..b7f5291 Binary files /dev/null and b/django_practiceEnglish_app/mysite/__pycache__/settings.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/mysite/__pycache__/urls.cpython-310.pyc b/django_practiceEnglish_app/mysite/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000..6a8fc8d Binary files /dev/null and b/django_practiceEnglish_app/mysite/__pycache__/urls.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/mysite/__pycache__/wsgi.cpython-310.pyc b/django_practiceEnglish_app/mysite/__pycache__/wsgi.cpython-310.pyc new file mode 100644 index 0000000..8eefa23 Binary files /dev/null and b/django_practiceEnglish_app/mysite/__pycache__/wsgi.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/mysite/asgi.py b/django_practiceEnglish_app/mysite/asgi.py new file mode 100644 index 0000000..7410c7c --- /dev/null +++ b/django_practiceEnglish_app/mysite/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for mysite 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.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + +application = get_asgi_application() diff --git a/django_practiceEnglish_app/mysite/settings.py b/django_practiceEnglish_app/mysite/settings.py new file mode 100644 index 0000000..2495b53 --- /dev/null +++ b/django_practiceEnglish_app/mysite/settings.py @@ -0,0 +1,126 @@ +""" +Django settings for mysite project. + +Generated by 'django-admin startproject' using Django 4.1.3. + +For more information on this file, see +https://docs.djangoproject.com/en/4.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.1/ref/settings/ +""" + +from pathlib import Path + +# 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.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-e6x=*qt4*qizkfk(*vrmheqwkm(^2wox!_2p7a3y*5po_t&tuq' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'PracticeEnglish', + 'users', + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + +] + +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 = 'mysite.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [BASE_DIR/"templates"], + '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 = 'mysite.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.1/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.1/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.1/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/django_practiceEnglish_app/mysite/urls.py b/django_practiceEnglish_app/mysite/urls.py new file mode 100644 index 0000000..d5a77d3 --- /dev/null +++ b/django_practiceEnglish_app/mysite/urls.py @@ -0,0 +1,27 @@ +"""mysite URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include + + +from users import views as user_views + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', include('PracticeEnglish.urls')), + # path('register/', user_views.register,name='register'), + +] diff --git a/django_practiceEnglish_app/mysite/wsgi.py b/django_practiceEnglish_app/mysite/wsgi.py new file mode 100644 index 0000000..de5ff5c --- /dev/null +++ b/django_practiceEnglish_app/mysite/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for mysite 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.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + +application = get_wsgi_application() diff --git a/django_practiceEnglish_app/users/__init__.py b/django_practiceEnglish_app/users/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_practiceEnglish_app/users/__pycache__/__init__.cpython-310.pyc b/django_practiceEnglish_app/users/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..7c4e3f8 Binary files /dev/null and b/django_practiceEnglish_app/users/__pycache__/__init__.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/users/__pycache__/admin.cpython-310.pyc b/django_practiceEnglish_app/users/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000..ca1a4d7 Binary files /dev/null and b/django_practiceEnglish_app/users/__pycache__/admin.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/users/__pycache__/apps.cpython-310.pyc b/django_practiceEnglish_app/users/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000..d461b3a Binary files /dev/null and b/django_practiceEnglish_app/users/__pycache__/apps.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/users/__pycache__/models.cpython-310.pyc b/django_practiceEnglish_app/users/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000..fed96a9 Binary files /dev/null and b/django_practiceEnglish_app/users/__pycache__/models.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/users/__pycache__/views.cpython-310.pyc b/django_practiceEnglish_app/users/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000..fba24a6 Binary files /dev/null and b/django_practiceEnglish_app/users/__pycache__/views.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/users/admin.py b/django_practiceEnglish_app/users/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/django_practiceEnglish_app/users/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/django_practiceEnglish_app/users/apps.py b/django_practiceEnglish_app/users/apps.py new file mode 100644 index 0000000..72b1401 --- /dev/null +++ b/django_practiceEnglish_app/users/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class UsersConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'users' diff --git a/django_practiceEnglish_app/users/migrations/__init__.py b/django_practiceEnglish_app/users/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/django_practiceEnglish_app/users/migrations/__pycache__/__init__.cpython-310.pyc b/django_practiceEnglish_app/users/migrations/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..b5316d0 Binary files /dev/null and b/django_practiceEnglish_app/users/migrations/__pycache__/__init__.cpython-310.pyc differ diff --git a/django_practiceEnglish_app/users/models.py b/django_practiceEnglish_app/users/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/django_practiceEnglish_app/users/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/django_practiceEnglish_app/users/template/users/register.html b/django_practiceEnglish_app/users/template/users/register.html new file mode 100644 index 0000000..d67c7fc --- /dev/null +++ b/django_practiceEnglish_app/users/template/users/register.html @@ -0,0 +1,20 @@ +{% extends 'PracticeEnglish/base.html' %} +{% block content %} +
+
+ {% csrf_token %} +
+ Join Today + {{form.as_p}} +
+
+ +
+
+
+ + Alredy Have An Account?Sign In + +
+
+{% endblock content %} \ No newline at end of file diff --git a/django_practiceEnglish_app/users/tests.py b/django_practiceEnglish_app/users/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/django_practiceEnglish_app/users/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/django_practiceEnglish_app/users/urls.py b/django_practiceEnglish_app/users/urls.py new file mode 100644 index 0000000..547eb38 --- /dev/null +++ b/django_practiceEnglish_app/users/urls.py @@ -0,0 +1,10 @@ +from django.contrib import admin +from django.urls import path, include + + +from users import views as user_views + +urlpatterns = [ + path('register/', user_views.register ,name='register'), + +] \ No newline at end of file diff --git a/django_practiceEnglish_app/users/views.py b/django_practiceEnglish_app/users/views.py new file mode 100644 index 0000000..4acdaf9 --- /dev/null +++ b/django_practiceEnglish_app/users/views.py @@ -0,0 +1,15 @@ +from django.shortcuts import render,redirect +from django.contrib.auth.forms import UserCreationForm +from django.contrib import messages +def register(request): + if request.method=="POST": + form=UserCreationForm(request.POST) + if form.is_valid(): + form.save() + username=form.cleaned_data.get('username') + messages.success(request,f'Account created for {username}!') + return redirect('welcome') + else: + form=UserCreationForm() + return render(request,'users/register.html',{'form':form}) +