This is a Django project named Electron-Store.
To get started with this project, follow these steps:
-
Install Python and Django:
- Install Python 3.8 from https://www.python.org/downloads/
- Install Django using pip:
pip install django
-
Clone the repository:
- Use Git to clone this repository:
https://github.com/codeBOKER/Electron-Store.git
- Use Git to clone this repository:
-
Set up the environment variables:
- Create a
.envfile in the root directory of the project. - Add the following environment variables:
DJANGO_SECRET_KEY=your-secret-key DB_NAME=your-database-name DB_USER=your-database-user DB_PASSWORD=your-database-password DB_HOST=your-database-host DB_PORT=your-database-port- Generate a secret key using Django's built-in
get_random_secret_key()function:from django.core.management.utils import get_random_secret_key # Generate a new secret key secret_key = get_random_secret_key() # Add the secret key to your .env file with open('.env', 'a') as f: f.write(f'DJANGO_SECRET_KEY={secret_key}\n')
- Generate a secret key using Django's built-in
- Create a
-
Install project dependencies:
- Navigate to the project directory:
cd project - Install the required dependencies:
pip install -r requirements.txt
- Navigate to the project directory:
-
Apply database migrations:
- Run the following command to apply database migrations:
python manage.py migrate
- Run the following command to apply database migrations:
-
Create a superuser:
- Run the following command to create a superuser:
python manage.py createsuperuser
- Run the following command to create a superuser:
-
Run the development server:
- Run the following command to start the development server:
python manage.py runserver
- Run the following command to start the development server:
-
Access the project in your browser:
- Open your web browser and navigate to http://127.0.0.1:8000/
The project structure is as follows:
Electron-Store/
├── core/
│ ├── templates/
│ │ └── (template files)
│ ├── static/
│ │ └── (static files)
│ ├── admin.py
│ ├── apps.py
│ ├── models.py
│ ├── tests.py
│ └── views.py
├── manage.py
├── project/
│ ├── asgi.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── staticfiles/
│ └── (collected static files)
├── media/
│ └── (uploaded media files)
└── .env
Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request.`.