Dataset 🔗 : https://www.kaggle.com/mlg-ulb/creditcardfraud
I. Create a Virtual Environment :
- Open your terminal or command prompt.
- Navigate to your project directory (where you want to create the virtual environment).
- Run the following command to create a virtual environment :
virtualenv venv
II. Activate the Virtual Environment:
- Depending on your operating system:
- On Windows:
- On macOS/Linux:
venv\Scripts\activate
source venv/bin/activate
III. Install Project Dependencies:
- Make sure you have a requirements.txt file in your project directory. If not, create one and list all the required packages (dependencies) for your Django project.
- Run the following command to install the dependencies:
pip install -r requirements.txt
IV. Create a Superuser:
- In your project root directory (where manage.py is located), run the following command:
- Follow the prompts to set a username, email, and password for the superuser. This user will have administrative privileges in your Django application.
python manage.py createsuperuser
V. Run the Development Server:
- Start your Django development server by running:
- Open your web browser and visit http://127.0.0.1:8000/ to see your Django app in action.
python manage.py runserver
📌 If you are adding some model in models.py or changing something don't forget to make migrations :
python manage.py makemigrations
and migrate it to database :
python manage.py migrate
This ensures that your database schema is up to date with your model changes.