Skip to content

Commit

Permalink
fix(docs): Tutorial and README broken links #235 (#238)
Browse files Browse the repository at this point in the history
Fix: Create Project tutorial was not in the index correctly.
Fix: Create Project tutorial broken link to Custom User.
Fix: README broken link to Custom User.
Improve: Create Project tutorial Troubleshooting section.

closes #235
  • Loading branch information
imAsparky authored Jan 10, 2022
1 parent 56fe7fa commit 034f522
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 13 deletions.
17 changes: 12 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
===========================
**Django 4.0 Cookiecutter**
===========================
============================
**Django 4.0+ Cookiecutter**
============================

**Version 1.0 will signify the first stable Django build!**

Expand Down Expand Up @@ -52,17 +52,24 @@ Django Project Features
#. Improved Admin panel security requires an authorised user to be logged in.
The Admin panel now has the protections provided by django-allauth.

If you are new to Django and Cookiecutters and would like to take it for a spin,
see our tutorial, `Create a Django-Cookiecutter Project`_.


.. _Django-allauth: https://django-allauth.readthedocs.io/en/latest/installation.html
.. _SQLite: https://www.sqlite.org/index.html
.. _How-to Custom User: <https://django-cookiecutter.readthedocs.io/en/latest/how-tos/how-to-custom-user.html>

.. _How-to Custom User: https://django-cookiecutter.readthedocs.io/en/latest/how-tos/how-to-custom-user.html
.. _Create a Django-Cookiecutter Project: https://django-cookiecutter.readthedocs.io/en/latest/tutorials/tutorial-create-django-project.html

Django Project Creation Options
-------------------------------

Customise your project with the following options when creating your
django-cookiecutter.

If you are new to Django and arent sure what to select, choose the default
setting to get the best new user experience.

Django Settings
~~~~~~~~~~~~~~~

Expand Down
59 changes: 51 additions & 8 deletions docs/source/tutorials/tutorial-create-django-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

.. _cookie-create-pkg:
============================
Create a Django Cookiecutterrk

Create a Django Cookiecutter
============================

|
Expand Down Expand Up @@ -599,7 +598,7 @@ For example, you can change the default user types to suit your application.

See `How-to Custom User`_ for customisation options before your initial migration.

.. _How-to Custom User: <https://django-cookiecutter.readthedocs.io/en/latest/how-tos/how-to-custom-user.html>
.. _How-to Custom User: https://django-cookiecutter.readthedocs.io/en/latest/how-tos/how-to-custom-user.html


Final Project Setup
Expand Down Expand Up @@ -629,11 +628,11 @@ You will see something similar to this in your CLI.
.. code-block:: bash
Migrations for 'account':
/home/mdev/projects/dlet/venv/lib/python3.10/site-packages/allauth/account/migrations/0004_alter_emailaddress_id_alter_emailconfirmation_id.py
/projects/my-new-django/venv/lib/python3.8/site-packages/allauth/account/migrations/0004_alter_emailaddress_id_alter_emailconfirmation_id.py
- Alter field id on emailaddress
- Alter field id on emailconfirmation
Migrations for 'socialaccount':
/home/mdev/projects/dlet/venv/lib/python3.10/site-packages/allauth/socialaccount/migrations/0005_alter_socialaccount_id_alter_socialapp_id_and_more.py
/projects/my-new-django/venv/lib/python3.8/site-packages/allauth/socialaccount/migrations/0005_alter_socialaccount_id_alter_socialapp_id_and_more.py
- Alter field id on socialaccount
- Alter field id on socialapp
- Alter field id on socialtoken
Expand Down Expand Up @@ -803,16 +802,59 @@ superuser credentials you have created.
Congratulations, you have created your new Django project.


Not working?
~~~~~~~~~~~~
Troubleshooting
---------------

|
The website wont run
~~~~~~~~~~~~~~~~~~~~

Check config/settings/local.py contains:

.. code-block:: python
ALLOWED_HOSTS = ["127.0.0.1"]
|
The tests wont run
~~~~~~~~~~~~~~~~~~

You are getting an error message that psycopg2 won't be installed.

`Psycopg2`_ is the most popular PostgreSQL database adapter for the Python
programming language.

psycopg2 is the default PostgreSQL adaptor used in django-cookiecutter.
psycopg2 has some dependencies to be built from source, and on occasion,
these may not be available on some peoples computers.

An alternative, the psycopg2-binary package, is available for beginners to start
using Python and PostgreSQL; however, this package is not suitable for
production.

Navigate to `/config/requirements/test.txt`, and you should see something
like the code below.

Comment line 3 and uncomment line 4. This action will select the option
to use psycopg2-binary.


.. code-block:: python
:caption: /config/requirements/test.txt
:linenos:
coverage==6.2
dj-inmemorystorage==2.1.0
psycopg2==2.9.3 # This version should be used in production
# psycopg2-binary # This version is ok for Development and Testing
pytest==6.2.5
pytest-django==4.5.2
pytest-reverse==1.3.0
pytest-xdist==2.5.0
tblib==1.7.0
tox==3.24.5
Whats next?
Expand All @@ -823,9 +865,10 @@ Whats next?
or you can

Check out our other :ref:`Tutorials<tutorial-index>` for more information on
how to get the most out of your cookiecutter package.
how to get the most out of your django-cookiecutter package.



.. _cookiecutter: https://cookiecutter.readthedocs.io/en/1.7.2/installation.html
.. _Django: https://docs.djangoproject.com/en/4.0/
.. _Psycopg2: https://www.psycopg.org/docs/

0 comments on commit 034f522

Please sign in to comment.