Because PI's from our company like Python/Django, we had to deploy our parking app on Heroku. In order to do that, I did a lot of search so, only 2 articles had the info that we needed to do that. One [from codingforentrepreneurs]. The second one was from the blog of Vitor Freitas, [simpleisbetterthancomplex.]
Both of them complete each other, but a beginner needs to have all of the steps out there. Both articles are incomplete, just because they are old.
So here we go. This is how my project structure looks like.
<img src="https://preview.ibb.co/fd3PYe/1.png" alt="1" border="0" class="img-fluid">
1. Go to your father folder: `cd Desktop/chn_parcare/` In our situation chn_parcare is our main folder.
<img src="https://image.ibb.co/mX54Ye/2.png" alt="2" border="0" class="img-fluid">
2. Do a `git init` <img src="https://image.ibb.co/gRCtte/3.png" alt="3" border="0" class="img-fluid">
3. `cd src` and `git init` . Now you are in the source folder of your project. Into this folder there is also manage.py
<img src="https://image.ibb.co/gkYSKK/4.png" alt="4" border="0" class="img-fluid">
<img src="https://image.ibb.co/hm6uYe/5.png" alt="5" border="0" class="img-fluid">
4. Go to Heroku and [SignUp] and then install the [CLI.]
5. In your terminal `heroku login`
<img src="https://image.ibb.co/gnmHmz/6.png" alt="6" border="0" class="img-fluid">
6. Create `.gitignore` and `Procfile`
echo ".py[cod]" > .gitignore
echo "web: gunicorn chn_parking.wsgi" > Procfile
<img src="https://image.ibb.co/kyQSmz/7.png" alt="7" border="0" class="img-fluid">
7. Ok! now there is a need of python3 -V to know the right version of python that needs to be installed on Heroku. Therefore there is still a need of creating another file. On the terminal type: `echo "3.7.0" > runtime.txt`
<img src="https://image.ibb.co/nGCezK/8.png" alt="8" border="0" class="img-fluid">
8. Now go back to your src folder `cd ..` and activate virtual environment `source bin/activate` and install Whitenoise `pip install whitenoise`.
<img src="https://image.ibb.co/eShCKK/9.png" alt="9" border="0" class="img-fluid">
9. Now go back to the src folder `cd src` and do `pip freeze > requirements.txt`. We need this just because Heroku has to know what libraries you need in order to run your site.
<img src="https://image.ibb.co/ha3ite/10.png" alt="10" border="0" class="img-fluid">
These are my requirements:
10. Now let's move to wsgi.py and add `from whitenoise.django import DjangoWhiteNoise` and `application = DjangoWhiteNoise(application)`
<img src="https://preview.ibb.co/kX356z/11.png" alt="11" border="0" class="img-fluid">
11. Now we have to create the app by giving a name: `heroku create parking-chn`. Our is called parking-chn, you can put a different name
12. To `settings.py` you need to `DEBUG = False` `ALLOWED_HOSTS = ['parking-chn.herokuapp.com, '.herokuapp.com']`
Add this to Middleware: `'whitenoise.middleware.WhiteNoiseMiddleware',`
<img src="https://image.ibb.co/fkpL6z/12.png" alt="12" border="0" class="img-fluid">
to the DB:
db_from_env = dj_database_url.config()
DATABASES['default']['CONN_MAX_AGE'] = 500
<img src="https://image.ibb.co/iqAA6z/13.png" alt="13" border="0" class="img-fluid">
Add to the static: `STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'`
<img src="https://preview.ibb.co/c6CjYe/14.png" alt="14" border="0" class="img-fluid">
13. `heroku config:set SECRET_KEY='your pass'` and change the secret key
SECRET_KEY = os.environ.get(
'SECRET_KEY', 'my key')
<img src="https://image.ibb.co/i624zK/16.png" alt="16" border="0" class="img-fluid">
14 `pip install django psycopg2 dj-database-url gunicorn` , than `pip freeze > requirements.txt`, than `git add .`, adding the message `git commit -m "Initial Heroku commit` and finally `git push heroku master`
15 Create and migrate the DB `heroku addons:create heroku-postgresql:hobby-dev` and `heroku run python manage.py migrate`, `heroku run python manage.py makemigrations` and `heroku run python manage.py createsuperuser` and finaly `heroku run python manage.py collectstatic`. Now disable collectstatic `heroku config:set DEBUG_COLLECTSTATIC=1`
<img src="https://preview.ibb.co/gXZy9K/18.png" alt="18" border="0" class="img-fluid">
COHEN INVESTIGATIONS AGENCY SRL
Email: [email protected]
#detectivparticular #pi #romania #bucuresti #investigatii #it #cybersecurity #detectiv #detectivi #politia #police #inselaciuni #verificari #siguranta #incredere #iubit #iubita #iubire #security #homeprotection #protection #tscm #facialrecognition #recunoasterefaciala #soft #phishing #scams #chatboot #pi #robot #malitious #html #car #carrecognition #bucharest #bucuresti #nato #wearenato #heroku #development
Any actions and or activities related to the material contained within this Website is solely your responsibility.The misuse of the information in this website can result in criminal charges brought against the persons in question. The authors and Our Company will not be held responsible in the event any criminal charges be brought against any individuals misusing the information in this website to break the law.
This site contains materials that can be potentially damaging or dangerous. If you do not fully understand something on this site, then GO OUT OF HERE! Refer to the laws in your province/country before accessing, using,or in any other way utilizing these materials.These materials are for educational and research purposes only!
Do not attempt to violate the law with anything contained here. If this is your intention, then LEAVE NOW! Neither administration of this server, the authors of this material, or anyone else affiliated in any way, is going to accept responsibility for your actions. Neither the creator nor Our Company is responsible for the comments posted on this website.
Any linked sites are not under the control of author or Our Company and the author or Our Company is not responsible for the contents of any linked site or any link contained in a linked site, or any changes or updates to such sites. We are providing these links to you only as a convenience, and the inclusion of any link does not imply endorsement by us.
In any site as large as ours that deals with so many controversial topics and skills, it has become necessary to address a few incidents and implement a user terms and services agreement. We want to provide a free, safe and legal training environment to the users of this site.
Our Company : This website will help you gain entry into the minds of seasoned computer criminals, so that you can forestall their attempts and you will be hence well equipped to detect the ways in which hackers can infiltrate your system.
Your usage of this website constitutes your agreement to the following terms.
- All the information provided on this site are for educational purposes only. The site is no way responsible for any misuse of the information.
- Our Company is a site related to Computer Security and not a site that promotes hacking /cracking / software piracy.
- This site is totally meant for providing information on “Computer Security”, “Computer Programming” and other related topics and is no way related towards the terms “CRACKING” or“HACKING” (Unethical).
- Few articles (posts) on this site may contain the information related to “Hacking Passwords” or“Hacking Email Accounts” (Or Similar terms). These are not the GUIDES of Hacking. They only provide information about the legal ways of retrieving the passwords. You shall not misuse the information to gain unauthorised access. However you may try out these hacks on your own computer at your own risk. Performing these attempts (without permission) on computers that you do not own is illegal.
- The virus creation section on this site provides demonstration on coding simple viruses using high level programming languages. These viruses are simple ones and cause no serious damage to the computer. However we strongly insist that these information shall only be used to expand programming knowledge and not for causing malicious attacks.
- All the information on this site are meant for developing Defense attitude among the users and help preventing the hack attacks. Our Company insists that these information shall not be used for causing any kind of damage directly or indirectly. However you may try these codes on your own computer at your own risk.
- The word “Hack” or “Hacking” that is used on this site shall be regarded as “Ethical Hack” or “Ethical Hacking” respectively.
- We believe only in White Hat Hacking. On the other hand we condemn Black Hat Hacking.
- Some of the tricks provided by us may no longer work due to fixture in the bugs that enabled the exploits. We are not responsible for any direct or indirect damage caused due to the usage of the hacks provided on this site.
- The site holds no reponsiblity for the contents found in the user comments since we do not monitor them. However we may remove any sensitive information present in the user comments upon request.
- We reserve the right to modify the Disclaimer at any time without notice.
- We are not the vendors of any products (software, books etc.) that we recommend on our website in the PRODUCTS section and other selected posts/articles. Hence we do not have any liability related to the products recommend by us. It is the responsibility of the buyers to contact the respective vendors for any queries related to the products.