This guide explains how to set up and run the Django project. Follow the steps below to install dependencies, configure the environment, and start the project.
git clone https://github.com/abdullokhonz/itproger.git
cd itproger
Before installing dependencies, create and activate a virtual environment:
-
Windows:
python -m venv venv venv\Scripts\activate
-
Mac/Linux:
python -m venv venv source venv/bin/activate
Once the virtual environment is activated, install the required packages:
pip install -r requirements.txt
Create a .env
file in the project's root directory and add the following variables:
SECRET_KEY=your-secret-key
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
DATABASE_URL=sqlite:///db.sqlite3
Before running the project, apply database migrations:
python manage.py migrate
If you need access to the Django admin panel, create a superuser:
python manage.py createsuperuser
Follow the prompts to set up a username, email, and password.
Start the Django development server with:
python manage.py runserver
The project will be available at:
➡️ http://127.0.0.1:8000/
-
Collect static files (for production):
python manage.py collectstatic
-
Run tests:
python manage.py test
When you're done, deactivate the virtual environment:
deactivate