Skip to main content

A Django command to create a project and app with a single command

Project description

Django Hey

Django Hey is a lightweight, command-line utility that simplifies the process of initializing Django projects and applications. With a single command, it automates the creation of a Django project, an accompanying app, URL configurations, and a starter view—streamlining your workflow and letting you dive into development faster. Built for developers of all levels, django-hey ensures consistency and efficiency in setting up Django environments.

Key Features

  • Rapid Project Setup: Generate a fully structured Django project in seconds.
  • App Creation: Automatically create an app within your project.
  • URL Configuration: Pre-configure urls.py for both project and app with a default route.
  • Settings Integration: Seamlessly add your app to the project's INSTALLED_APPS.
  • Starter View: Include a basic view with a welcome message to get you started.
  • Verbose Feedback: Receive clear success messages for each step.
  • Virtual Environment Support: Automatically create and configure a virtual environment (venv) with Django installed.

Installation

To use django-hey, ensure you have Python 3.6+ installed. Install the package globally via pip:

pip install django-hey

Prerequisites

Django: The tool requires Django 3.0 or higher. Install it if not already present:

pip install django>=3.0

Usage

Run the following command to create a new Django project and app:

hey django create <project_name> <app_name>

Example

hey django create blogproject blogapp

What It Does

  • Creates a virtual environment (venv) in the current directory and installs Django (>=3.0) within it.

  • Creates a Django project named blog_project in your current directory using the virtual environment.

  • Adds an app named blogapp inside blogproject.

  • Generates blogapp/urls.py with a default route ('') linked to a home view.

  • Updates blogproject/settings.py to include blogapp in INSTALLED_APPS.

  • Modifies blogproject/urls.py to integrate blogapp.urls.

  • Creates a home view in blogapp/views.py that returns "Welcome to blogapp!".

Command Output

Virtual environment 'venv' created successfully!
Django installed successfully in the virtual environment!

Please activate the virtual environment before running the server:
Copy and paste this command in your terminal and press Enter:
  venv\Scripts\activate.bat  (Windows)
  source venv/bin/activate   (macOS/Linux)
After activation, run: python manage.py runserver
Virtual environment created at: /path/to/current/directory/venv
Project 'blogproject' created successfully!
App 'blogapp' created successfully!
'urls.py' created in 'blogapp' successfully!
App 'blogapp' added to INSTALLED_APPS!
Project 'urls.py' updated to include 'blogapp.urls'!
Basic view created in 'blogapp/views.py'!

Running Your Project

Navigate to the project directory and launch the development server:

cd blogproject
venv\Scripts\activate  # On Windows
source venv/bin/activate  # On macOS/Linux
python manage.py runserver

Open your browser to http://127.0.0.1:8000/ to see "Welcome to blogapp!".

Requirements

  • Python: Version 3.6 or later
  • Django: Version 3.0 or later (installed separately)

Troubleshooting

  • "django-admin: command not found": Install Django with pip install django and ensure it's available in your PATH.
  • Permission Issues: Run your terminal with elevated privileges or use a virtual environment.
  • Command Not Recognized: Confirm installation with pip show django-hey and check your PATH.

Contributing

Contributions are welcome! To contribute:

  • Fork the repository on GitHub.
  • Submit pull requests with improvements or bug fixes.
  • Report issues or suggest features via the issue tracker.

License

django-hey is released under the MIT License. See the LICENSE file for full details.

Author

Developed by Sabari Nathan
📧 Email: sabareee000@gmail.com
💻 GitHub: github.com/sabari7497

For questions, feedback, or support, feel free to reach out!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_hey-0.1.10.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_hey-0.1.10-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file django_hey-0.1.10.tar.gz.

File metadata

  • Download URL: django_hey-0.1.10.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for django_hey-0.1.10.tar.gz
Algorithm Hash digest
SHA256 fc072716c47b5f309a4c0eaccd3511e13d19f8943453c179f38d01392b9185ef
MD5 add16c185ff3148452e1851913f0edfc
BLAKE2b-256 e81f46711b3f9056b2230f6398bcad0c82e35746f877a9ee4556daca93b34b2f

See more details on using hashes here.

File details

Details for the file django_hey-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: django_hey-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for django_hey-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 731594bcad907fc715d50a2754e0888900a94cf5dce18e807564cfd7bef4a518
MD5 08cc31c76cf994f14e595ba7a845dc5b
BLAKE2b-256 7f05ee14eb239c8bb407273c3ba0324b2d341ceb8dfe5d1ae6f80bd8e9c75e3a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page