-
Clone the Repository
git clone https://github.com/CaseQuill/django-starter.git cd django-starter -
Install Poetry
Ensure that Poetry is installed on your system. If not, install it using:
curl -sSL https://install.python-poetry.org | python3 -For more installation options, visit the Poetry documentation.
-
Install Project Dependencies
poetry install
This command will:
- Create a virtual environment (if one doesn't exist).
- Install all dependencies specified in
pyproject.toml.
-
Make and Apply Migrations
poetry run python manage.py makemigrations poetry run python manage.py migrate
-
Create a Superuser (Optional)
If you want to use the admin interface to add items:
poetry run python manage.py createsuperuser
-
Run the Development Server
poetry run python manage.py runserver
-
Access the Application
- Item List View: http://localhost:8000/items/
- Admin Interface: http://localhost:8000/admin/
You can add sample data in two ways:
- Navigate to http://localhost:8000/admin/.
- Log in with your superuser credentials.
- Click on Items and add new items.
poetry run python manage.py shellThen, execute:
from core.models import Item
Item.objects.create(name='Sample Item 1')
Item.objects.create(name='Sample Item 2')
exit()You can activate the Poetry shell to avoid prefixing commands with poetry run:
poetry shellNow you can run Django commands directly:
python manage.py migrate
python manage.py runserver- Ensure you have Python 3.6 or higher installed.
- If you encounter any issues, please check your Python and Poetry installations.
- For any questions or issues, feel free to contact us at rachel.weems@goknit.com.
This starter project includes:
- A Django project set up with Poetry for dependency management.
- A
coreapp with a simpleItemmodel. - A basic view (
item_list) that displays a list ofIteminstances. - Templates configured to render the
item_list.html. - URLs configured to route to the
item_listview. - Instructions to help you get started quickly.