python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
y por ultimo borrar del README.md estas lineas xd (borrar la 1 hasta la 19)
Clone .env.example file and rename it as .env
#If you have Conda, use "conda deactivate"
python -m venv venv
./venv/Scripts/Activate.ps1 #If you use Linux, use ". ./venv/bin/activate"
pip install -r requirements.txt
docker-compose up -d
./local_dev_db/import_test_db.ps1 #If you use Linux, use "bash . ./local_dev_db/import_test_db.ps1"
** At this point, MySQL should be running **
After doing these steps, see Run Server and Development User Login Credentails
You'll need these commands in the specified order, to execute the project you'll need to activate the virtual enviroment first, and then start the dockerized database.
./venv/Scripts/Activate.ps1 #If you use Linux, use ". ./venv/bin/activate"
docker-compose start -d
docker-compose stop
First time run: you should Run the initial migrations
python manage.py runserver
python manage.py createsuperuser
This only applies in case there's a database provided with this repository
Username: --insert here--
Password: --insert here--
python manage.py makemigrations
python manage.py migrate
python manage.py startapp nombreApp
- Create the app and add its path to the general urls.py file. REMEMBER! Add it to both the import & the urlpattern
- Add the app name to the djangoproject/settings.py file inside the INSTALLED_APPS variable (after the comment in line 37, #Django Project Apps)
- Copy the urls.py of the example app into your new one and change the app_name variable that is written after the imports
- Copy the models.py and forms.py of the exampleApp and adequate their logic to fit your new app.
- You'll most probably need to change the views.py logic
- Finally, change all of the urls from exampleApp (eg. exampleApp:index) for the app name that you set.
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
python manage.py createsuperuser
Remember that you have to add your current model into the app's admin.py in order for it to list the entity in the Django Admin
pip freeze > requirements.txt
- Download the Markdown Preview Github Extension
- Hit Ctrl + Shift + V