A django based applicaiton for making a developer's profile with feature like showcasing skills, tech Stack and Peojects.
- Django
- Python 3.12.x
- HTML/CSS/JS
- JavaScript (optional)
- Database name - can be used any on your preference (PostgreSQL, MySQL, SQLite)
- Tailwincss
Before you begin, ensure you have the following installed:
- Python 3.12
- Django 3.x+
- pip (Python package manager)
- [Optional] Virtual environment tool (
virtualenvorvenv)
-
Clone the repository:
git clone https://github.com/CodeWithSaurabhYadav/dev_stack
-
Navigate to the project directory:
cd dev_stack -
Create and activate a virtual environment (recommended):
# For virtualenv virtualenv venv source venv/bin/activate # On Windows use `venv\Scripts\activate` # For venv (Python 3 built-in) python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install project dependencies:
pip install -r requirements.txt
-
Set up the database:
- If you are using the default SQLite database, Django will create it automatically. Otherwise, configure your database settings in the settings.py file, and then run:
python manage.py migrate
-
Create a superuser (admin account):
python manage.py createsuperuser
-
Run the development server:
- gunicorn is used because of this application being a ASGI application and not WSGI
- Note:
python manage.py runserverdoes not run the application in ASGI
gunicorn dev_stack.asgi:application -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000
Open your browser and navigate to http://127.0.0.1:8000/ to access the project.
To change the database settings, open the settings.py file and modify the DATABASES setting. Example for PostgreSQL:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'your_db_name',
'USER': 'your_db_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}or
# To use this you will need to create a file named 'db.sqlite3'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}Django collects static files using the collectstatic command. Ensure that STATIC_URL and STATIC_ROOT are properly configured in settings.py. Run:
python manage.py collectstatic