Download all the files
- Requirements: Commandprompt/ Console/ Terminal , browser
username: prohuman password: Admin@28
Go inside the directory
-
To migrate all settigs
python manage.py migrate
-
python manage.py makemigrations memewebapp
-
To run server
python manage.py runserver
-
To create superuser
python manage.py createsuperuser
-
Login Page accepts username and password credentials with proper validation
-
Login user validates through database
-
Redirects to webpage where the cookies get stored for current session(You may need to reload the tab it does work on normal server hosted on pc after clicking accept). Each session has its own cookies
-
Informed the users that website collects the cookies and store their consent in database and ask for their choice to accept or decline. Cookies shown in the container at the bottom which fades away after 5 seconds.
-
If user accepts the cookies 5 memes are shown from the api at https://imgflip.com/api
-
else user will be displayed sorry message and the session will be logged out
------------------ DEPLOYEMENT STEPS ON PYTHONANYWHERE ---------------
-
Signup for new account if don’t have any
-
Open console
TYPE:
-
pwd
-
git clone ‘https://github.com/hackzbhavin/MEME-WEBAPP’
-
mkvirtualenv –python=/usr/bin/python3.5 myenv
-
pip install django
-
pip install requests
-
Now open dashboard in another tab till the task is running on console
-
Go to web tab
-
create web app click next
-
select manual configuration [ Select a Python Web Framework]
-
choose python 3.5
-
You will have your web app ready just need to add more settings
-------------------------- Customize your web tab--------------------------
- edit virtual env add myenv
........(environment name created in console)
- edit code edit WSGI configuration file
remove everything just keep the django part and remove the comment like below attached screeenshot modify path modify os.environ['DJANGO_SETTINGS_MODULE'] save the file
-
update allowed host in project FILES in settings.py add the url without http example: ALLOWED_HOSTS = ['hackzbhavin.pythonanywhere.com']
-
Now reload the url you may find the css is not loaded on the html page
-
At the end of the file add STATIC_ROOT='/home/hackzbhavin/MEME-WEBAPP/static'
-
In console run python manage.py collectstatic
-
In WEB tab STATIC FILES url : /static/ directory : /home/hackzbhavin/MEME-WEBAPP/static
-
Dont forget to RELOAD