Skip to content

Commit

Permalink
Reflect (somewhat) the new folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
csev committed Apr 23, 2019
1 parent 1cbb2b3 commit 49ec6be
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion assn/dj4e_ads2.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Updating Requirements
---------------------

(1) Do a `git pull` in your `dj4e-samples` repo and make sure all the pre-requisites are
installed. Copy `samples/requirements.txt` to `adlist/requirements.txt` and launch a
installed. Copy `dj4e-samples/requirements.txt` to `adlist/requirements.txt` and launch a
shell in your virtual environment and run:

pip install -r requirements.txt # or pip3
Expand Down
24 changes: 12 additions & 12 deletions assn/dj4e_autos.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ This assignment is to build a fully working CRUD (Create, Read, Update, and Dele
application to manage automobiles and their makes (i.e. Ford, Hyundai, Toyota,
Tata, Audi, etc.).

This application will be based on this repo:
This application will be based on this folder in the samples repo:

https://github.com/csev/dj4e-samples/tree/master/dj4ecrud
https://github.com/csev/dj4e-samples/tree/master/auto

**Do not clone this repository for this assignment**. You will make a new
project and application in your `django_projects` folder and use this application
Expand Down Expand Up @@ -45,7 +45,7 @@ application to provide convienent urls to switch between applications. If you
not use a template for your home page, it would probably be a good idea to switch
to the template pattern as shown in:

https://github.com/csev/dj4e-samples/blob/master/dj4ecrud/home/urls.py
https://github.com/csev/dj4e-samples/blob/master/home/urls.py

Your `home\urls.py` should have a like like this

Expand All @@ -67,50 +67,50 @@ Building the Autos Application

The essense of this task is to just copy the code from:

https://github.com/csev/dj4e-samples/tree/master/dj4ecrud
https://github.com/csev/dj4e-samples/tree/master/autos

and make it work in your `autos` project.

Here are some tasks:

* Edit `dj4e/urls.py` to route `autos/` urls to `autos/urls.py` file. Also route the `accounts/` url to the
Django built in login features and add the `admin/` route so you can work with your data.
(<a href="https://github.com/csev/dj4e-samples/blob/master/dj4ecrud/dj4ecrud/urls.py" target="_blank">Example</a>)
(<a href="https://github.com/csev/dj4e-samples/blob/master/dj4e-samples/urls.py" target="_blank">Example</a>)

* Edit the `autos/urls.py` file to add routes for the list, edit, and delete pages for both autos and makes
(<a href="https://github.com/csev/dj4e-samples/blob/master/dj4ecrud/autos/urls.py" target="_blank">Example</a>)
(<a href="https://github.com/csev/dj4e-samples/blob/master/autos/urls.py" target="_blank">Example</a>)

* Edit the `autos/views.py` file to add views for the list, edit, and delete pages for both autos and makes.
You can ignore the `cleanup` stuff.
(<a href="https://github.com/csev/dj4e-samples/blob/master/dj4ecrud/autos/views.py" target="_blank">Example</a>)
(<a href="https://github.com/csev/dj4e-samples/blob/master/autos/views.py" target="_blank">Example</a>)

* Create the necessary templates in `home\templates\registration` to support the login / log out views.
(<a href="https://github.com/csev/dj4e-samples/blob/master/dj4ecrud/home/templates" target="_blank">Example</a>)
(<a href="https://github.com/csev/dj4e-samples/blob/master/home/templates" target="_blank">Example</a>)

* Edit the `autos/models.py` file to add Auto and Makes models with a foreign key from Autos to Makes.
(<a href="https://github.com/csev/dj4e-samples/blob/master/dj4ecrud/autos/urls.py" target="_blank">Example</a>)
(<a href="https://github.com/csev/dj4e-samples/blob/master/autos/urls.py" target="_blank">Example</a>)

<img src="svg/auto_model.svg" alt="A data model diagram showing Autos and Makes" style="display: block; margin-left: auto; margin-right: auto;align: center; max-width: 300px;">

* Run the commands to perform the migrations.

* Edit `autos\admin.py` to add the Auto and Make models to the django administration interface.
(<a href="https://github.com/csev/dj4e-samples/blob/master/dj4ecrud/autos/admin.py" target="_blank">Example</a>)
(<a href="https://github.com/csev/dj4e-samples/blob/master/autos/admin.py" target="_blank">Example</a>)

* Create a superuser so you can test the admin interface
and log in to the application.

* Create the necessary views in `autos\templates\autos` to support your views.
Note that the sample code uses a sub folder under `templates` to
make sure that templates are not inadvertently shared across multiple applications within a Django project.
(<a href="https://github.com/csev/dj4e-samples/blob/master/dj4ecrud/autos/templates" target="_blank">Example</a>)
(<a href="https://github.com/csev/dj4e-samples/blob/master/autos/templates" target="_blank">Example</a>)

Make sure to check the autograder for additional requirements.

References
----------

* <a href="https://github.com/csev/dj4e-samples/tree/master/dj4ecrud" target="_blank">Autos CRUD Sample Code</a>
* <a href="https://github.com/csev/dj4e-samples/tree/master/autos" target="_blank">Autos CRUD Sample Code</a>

* <a href="dj_install.md" target="_blank">Installing Django Locally</a>

Expand Down
4 changes: 2 additions & 2 deletions assn/dj4e_hello.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ patterns.

This application will end up with a similar structure to

https://github.com/csev/dj4e-samples/tree/master/onepage
https://github.com/csev/dj4e-samples/tree/master/autod

**Do not clone this repository**. It is just to be used as sample code as you
build your new project and application in your `django_projects` folder.
Expand Down Expand Up @@ -107,7 +107,7 @@ References

* <a href="https://github.com/csev/dj4e-samples/tree/master/dj4e" target="_blank">Hello World Sample Code</a>

* <a href="https://github.com/csev/dj4e-samples/tree/master/samples/templates" target="_blank">Templates Sample Code</a>
* <a href="https://github.com/csev/dj4e-samples/tree/master/tmpl" target="_blank">Templates Sample Code</a>

* <a href="dj_install.md" target="_blank">Installing Django Locally</a>

Expand Down
2 changes: 1 addition & 1 deletion assn/dj4e_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ is needed in order to store Python objects in the `scripts` folder.

Make a copy of the `many_load.py` from this folder into your `scripts` folder:

https://github.com/csev/dj4e-samples/tree/master/samples/scripts
https://github.com/csev/dj4e-samples/tree/master/scripts

Add the following line to your `locallibrary/locallibrary/settings.py`:

Expand Down
2 changes: 0 additions & 2 deletions assn/dj_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ Then lets checkout the dj4e-samples repo
Then lets setup the database for the main sample applications:

cd dj4e-samples
cd samples
python3 manage.py migrate
python3 manage.py runserver

Expand All @@ -114,7 +113,6 @@ Then just for fun, open a second terminal / shell / command line and:
cd Desktop
cd django
cd dj4e-samples
cd samples
python3 manage.py runserver 8001

Then navigate to http://localhost:8001 to see the page.
Expand Down
2 changes: 1 addition & 1 deletion assn/paw_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ as the course progresses and install some important additional Django software l

cd ~
git clone https://github.com/csev/dj4e-samples
cd dj4e-samples/samples
cd dj4e-samples
pip3 install -r requirements.txt

In the PYAW shell, continue the steps from the MDN:
Expand Down
2 changes: 1 addition & 1 deletion lectures/DJ-02-Model-Single.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ https://github.com/csev/dj4e-samples

Start the command line in a Linux/Bash shell and go into your project folder.

cd dj4e-samples/users
cd dj4e-samples

python3 manage.py makemigrations # May not find any changes
python3 manage.py migrate # Create the database and table(s)
Expand Down
2 changes: 1 addition & 1 deletion tools/crud/02spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<li>
The sample CRUD code that we covered in class and used in previous assignments.
<pre>
<a href="https://github.com/csev/dj4e-samples/tree/master/dj4ecrud" target="_blank">https://github.com/csev/dj4e-samples/tree/master/dj4ecrud</a>
<a href="https://github.com/csev/dj4e-samples/tree/master/autos" target="_blank">https://github.com/csev/dj4e-samples/tree/master/autos</a>
</pre>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion tools/crud2/02spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<li>
The sample code that we covered in class and used in previous assignments.
<pre>
<a href="https://github.com/csev/dj4e-samples/tree/master/samples" target="_blank">https://github.com/csev/dj4e-samples/tree/master/samples</a>
<a href="https://github.com/csev/dj4e-samples" target="_blank">https://github.com/csev/dj4e-samples</a>
</pre>
<?php if ( isset($particular) ) { ?>
In particular, pay attention to the <?= $particular ?> examples.
Expand Down
2 changes: 1 addition & 1 deletion tools/dj4e/02spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<li>
The sample CRUD code that we covered in class and used in previous assignments.
<pre>
<a href="https://github.com/csev/dj4e-samples/tree/master/dj4ecrud" target="_blank">https://github.com/csev/dj4e-samples/tree/master/dj4ecrud</a>
<a href="https://github.com/csev/dj4e-samples/tree/master/autos" target="_blank">https://github.com/csev/dj4e-samples/tree/master/autos</a>
</pre>
</li>
</ul>
Expand Down

0 comments on commit 49ec6be

Please sign in to comment.