https://github.com/zriyansh/django-starter
https://github.com/zriyansh/django-starter
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zriyansh/django-starter
- Owner: zriyansh
- Created: 2022-04-12T15:50:45.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-13T16:25:50.000Z (about 4 years ago)
- Last Synced: 2024-12-29T21:30:03.805Z (over 1 year ago)
- Language: Python
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# django-starter
This simple project is done insde a virtual environment.
To get started, follow these steps.
Note: The below steps are to autogenerate some boilerplate code, just like create-react-app.
make a dir --> cd to it.
```
sudo pip3 install virtualenvwrapper
```
activate virtual environment
```
virtualenv py_env
```
```
pip3 install django
```
To setup a new project structure.
```
django-admin startproject
```
To start server.
```
python3 manage.py runserver
```
If there are some warnings saying something about 'migrations' run this.
```
python manage.py migrate
```
to start a new app that inside the project
```
django-admin manage.py startapp
```
For help, refer to this [playlist](https://www.youtube.com/watch?v=SIyxjRJ8VNY&list=PLsyeobzWxl7r2ukVgTqIQcl-1T0C2mzau)
Project Structure:
1. dir django_one is the root project name.
2. dir calc is an app of the root project (for unknown reasons, I don't understand why can't we keep calc inside django_one dir)
3. dir templates is the place we keep html files.
4. local urls are set in calc/urls.py and then included in django_one/urls.py
5. line 58 of settings.py was modified to ```'DIRS': [os.path.join(BASE_DIR, 'templates' )],```, don't forget to import os at top.