My very first take on programming went like this: <i>Spent the whole day stuck on starting up a freaking django app</i> <i>I ran this same shit yesterday and everything went well in the end.</i> And it went like that for a reason. Whatever, we correcting that shit. Systems over goals. Tried to create multiple django projects multiple times today and got a hang of it. <h6>Creating a Django Project, App and running it Till the apps.views return the desired output (Without PipEnv) </h6> 1. Create a django project using 'django-admin startproject <i>projectName</i>' 2. Run the manage.py server using 'python manage.py runserver'. If you are not sure whether you in the right directory, type 'dir' into the command line and hit enter. If manage.py shows up as one of the files in that directory, you good to go. 3. Create an app inside the project by using 'python manage.py startapp <i>appName</i>' *Now, one of the most frustrating thing I have ever faced since starting django is how I went from easily creating a project that at least take me all the way to the admin page to the one that continuously show me this: .png) After battling with it, I discovered the singular reason why that happens: <h5>Not migrating means you will never SEE the ADMIN page!</h5> 4. Migrate using 'python manage.py migrate' .png) 5. To be able to login through the admin page, create super user. With 'python manage.py createsuperuser' 6. add newly created app to INSTALLED APPS in settings.py 7. Create urls.py for the app 8. Copy the main project's urls.py and copy it to the newly created app's urls.py then tweak it by by adding especially 'from . import views' ie import app.views into the app 9. Go to the newly created app's views.py and create exactly what you want the user to see <h5>END</h5> <sub><i>Stack Used: python 3.7; django 3.2</i></sub>
author | holybranches |
---|---|
permlink | documenting-working-codes-a-django-setup-routine-that-actually-works |
category | python |
json_metadata | {"tags":["python","programming","django","setup","issues"],"image":["https://images.hive.blog/DQmZz5kBrUJLbA6bteS9mjWvVwVJ8XpUkyzssoeGCf8JJLA/Screenshot%20(281).png","https://images.hive.blog/DQmVxuMPJWrTZthLj4rPwTTY117NVkRawAZF8afjMdcKx5R/Screenshot%20(282).png"],"app":"hiveblog/0.1","format":"markdown"} |
created | 2021-04-29 20:41:21 |
last_update | 2021-04-29 20:41:21 |
depth | 0 |
children | 1 |
last_payout | 2021-05-06 20:41:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 1.074 HBD |
curator_payout_value | 0.991 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,100 |
author_reputation | 8,432,821,397,316 |
root_title | "Documenting Working Codes - A Django Setup Routine that actually Works" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 103,380,006 |
net_rshares | 3,008,129,651,495 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
tombstone | 0 | 97,553,299,165 | 4.5% | ||
kevinwong | 0 | 1,736,805,282,109 | 25% | ||
good-karma | 0 | 32,629,337,095 | 3.27% | ||
esteemapp | 0 | 16,050,047,912 | 3.27% | ||
melinda010100 | 0 | 41,527,220,321 | 5% | ||
nurhayati | 0 | 1,137,971,984 | 25% | ||
esteem.app | 0 | 864,683,518 | 3.27% | ||
penderis | 0 | 73,431,210,150 | 100% | ||
sbi5 | 0 | 105,337,782,962 | 9.24% | ||
smokingfit | 0 | 5,945,664,210 | 100% | ||
sbi-tokens | 0 | 1,061,035,300 | 0.96% | ||
penned-bullshit | 0 | 844,782,015 | 100% | ||
ecency | 0 | 894,218,013,731 | 3.27% | ||
ecency.stats | 0 | 723,321,023 | 3.27% |
**Yay!** 🤗<br>Your post has been **boosted with Ecency Points**, by @penderis. <br>Use Ecency daily to boost your growth on platform! <br><br><b>Support Ecency</b><br>[Vote for Proposal](https://hivesigner.com/sign/update-proposal-votes?proposal_ids=%5B141%5D&approve=true)<br>[Delegate HP and earn more](https://ecency.com/hive-125125/@ecency/daily-100-curation-rewards)
author | ecency |
---|---|
permlink | re-2021429t224950533z |
category | python |
json_metadata | {"tags":["ecency"],"app":"ecency/3.0.5-welcome","format":"markdown+html"} |
created | 2021-04-29 22:49:51 |
last_update | 2021-04-29 22:49:51 |
depth | 1 |
children | 0 |
last_payout | 2021-05-06 22:49:51 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 371 |
author_reputation | 613,589,286,978,643 |
root_title | "Documenting Working Codes - A Django Setup Routine that actually Works" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 103,381,865 |
net_rshares | 0 |