Category: Developers

 

What is Pipenv for Python?

Why I need pipven?
Pipenv is a packaging tool for Python that solves some common problems associated with the typical workflow using pip, virtualenv, and the good old requirements.txt.

Pipenv is a dependency manager for Python projects. If you’re familiar with Node.js’ npm or Ruby’s bundler, it is similar in spirit to those tools. While pip can install Python packages, Pipenv is recommended as it’s a higher-level tool that simplifies dependency management for common use cases.

nstalling packages for your project
Pipenv manages dependencies on a per-project basis. To install packages, change into your project’s directory (or just an empty directory for this tutorial) and run:
On ubuntu:


$ mkdir myproject
$ cd myproject
$ pipenv install requests


Creating a virtualenv for this project...
Pipfile: /media/ukkgoodbye/Python/PythonDjangoWithMosh/myproject/Pipfile
Using /usr/local/bin/python3 (3.11.1) to create virtualenv...
⠼ Creating virtual environment...created virtual environment CPython3.11.1.final.0-64 in 303ms
creator CPython3Posix(dest=/home/iwc46/.local/share/virtualenvs/myproject-2c8shx2v, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/ukkgoodbye/.local/share/virtualenv)
added seed packages: pip==23.0, setuptools==67.1.0, wheel==0.38.4
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment!
Virtualenv location: /home/ukkgoodbye/.local/share/virtualenvs/myproject-2c8shx2v
Creating a Pipfile for this project…
Installing requests…
Resolving requests…
Installing…
Adding requests to Pipfile’s [packages] …
✔ Installation Succeeded
Pipfile.lock not found, creating…
Locking [packages] dependencies…
Building requirements…
Resolving dependencies…
✔ Success!
Locking [dev-packages] dependencies…
Updated Pipfile.lock (ff88c6939e3090788e917cfdecf1af872168b83c8803457853061495493b5a71)!
Installing dependencies from Pipfile.lock (3b5a71)…
To activate this project’s virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

pipenv request

For example for the project: e-smatsolution

$ cd e-smartsolution

Activing the pipven environment of the project

~esmartsoltion $ pipevn shell

Creating dhango admin

~esmartsoltion $django-admin startproject esmartsolution .

by adding “.” is tell django-admin to create the project inside the current folder.

To run the server:

python manage.py runserver


Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

You have 17 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run ‘python manage.py migrate‘ to apply them.

February 16, 2023 – 07:43:02
Django version 2.2.12, using settings ‘esmartsoltion.settings’
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[16/Feb/2023 07:43:09] “GET / HTTP/1.1” 200 16348
Not Found: /static/admin/css/fonts.css
[16/Feb/2023 07:43:09] “GET /static/admin/css/fonts.css HTTP/1.1” 404 2017
[16/Feb/2023 07:43:23] “GET /admin/ HTTP/1.1” 302 0
[16/Feb/2023 07:43:23] “GET /admin/login/?next=/admin/ HTTP/1.1” 200 1816
Not Found: /admin/login/static/admin/css/responsive.css
Not Found: /admin/login/static/admin/css/base.css
Not Found: /admin/login/static/admin/css/login.css
[16/Feb/2023 07:43:23] “GET /admin/login/static/admin/css/base.css HTTP/1.1” 404 3782
[16/Feb/2023 07:43:23] “GET /admin/login/static/admin/css/responsive.css HTTP/1.1” 404 3800
[16/Feb/2023 07:43:23] “GET /admin/login/static/admin/css/login.css HTTP/1.1” 404 3785
[16/Feb/2023 07:43:23] “GET /admin/ HTTP/1.1” 302 0
[16/Feb/2023 07:43:23] “GET /admin/login/?next=/admin/ HTTP/1.1” 200 1816
Not Found: /admin/login/static/admin/css/responsive.css
[16/Feb/2023 07:43:23] “GET /admin/login/static/admin/css/responsive.css HTTP/1.1” 404 3800

Djando-admin won’t load the css!

Runing a django project

Run migrations
python manage.py migrate
Create superuser
python manage.py createsuperuser
Start development server
python manage.py runserver
Access ​http://127.0.0.1:8000/admin/
Login with your superuser. You should get an error connecting to the server.
Check the running server. It should not be running.

Dns Propagation Check

Dns Propagation Check

Dns Propagation Check will check the propagation of DNS records across your servers for the selected DNS record type. You can use this tool to see if your records have propagated across all your servers, as well as identify possible DNS issues.
DNS tools

Command Explanation
a: DNS A record IP address for host name
mx: DNS MX records for domain
cname: DNS canonical host name to IP address
ptr: DNS PTR record for host name
spf: Check SPF records on a domain
txt: Check TXT records on a domain
soa: Get Start of Authority record for a domain

SEO tools used by ukgoodbye.co.uk

SEO Tools

1- SEMrush. SEMrush offers solutions for SEO, PPC, content, social media and competitive research.It is a SaaS product used by over 3,000,000 marketers worldwide.

2- Ahref: Audit your website, explore competitors, research keywords & backlinks – all in one place. Powered by seriously big data & trusted by top SEOs. It’ ss the newest entry into the link research tool space. They use their own bot and their own index (which they state is based on information from a trillion website connections).

 

WP, woocommerce stripe testing mode

WP, wooCommerce stripe testing mode

How to test payment gateway on WordPress?
Configured, tested and working on ukgoodbye, second life for stuff’ s website
Stripe works by adding payment fields on the checkout and then sending the details to Stripe for verification

 

2- Obtaining your API keys

Your API keys are always available in the Dashboard. For your convenience, your test API keys for esse.uk are:
Key Value
Publishable
pk_test_HtuBrUILSdaddasdasd
Secret
sk_test_VFSPCrdasdsaO4ZgTHy

Stripe automatically populates code examples in our documentation with your test API keys while you are logged in—only you can see these values.

Use only your test API keys for testing and development. This ensures that you don’t accidentally modify your live customers or charges.UKgoodbye stripe payment

3- Pay in test mod

Pay with your credit card via Stripe. TEST MODE ENABLED. In test mode, you can use the card number 4242424242424242 with any CVC and a valid expiration date or check the Testing Stripe documentation for more card numbers.

Us you see on the next image:

 

Test card numbers

Genuine card information cannot be used in test mode. Instead, use any of the following test card numbers, a valid expiration date in the future, and any random CVC number, to create a successful payment.

Number Brand
4242424242424242 Visa
4000056655665556 Visa (debit)
5555555555554444 Mastercard
2223003122003222 Mastercard (2-series)
5200828282828210 Mastercard (debit)
5105105105105100 Mastercard (prepaid)
378282246310005 American Express
371449635398431 American Express
6011111111111117 Discover
6011000990139424 Discover
30569309025904 Diners Club
38520000023237 Diners Club
3566002020360505 JCB
6200000000000005 UnionPay
Token Brand
tok_visa Visa
tok_visa_debit Visa (debit)
tok_mastercard Mastercard
tok_mastercard_debit Mastercard (debit)
tok_mastercard_prepaid Mastercard (prepaid)
tok_amex American Express
tok_discover Discover
tok_diners Diners Club
tok_jcb JCB
tok_unionpay UnionPay
Payment Method Brand
pm_card_visa Visa
pm_card_visa_debit Visa (debit)
pm_card_mastercard Mastercard
pm_card_mastercard_debit Mastercard (debit)
pm_card_mastercard_prepaid Mastercard (prepaid)
pm_card_amex American Express
pm_card_discover Discover
pm_card_diners Diners Club
pm_card_jcb JCB
pm_card_unionpay UnionPay

Each test card’s billing country is set to U.S. If you need to create test card payments using cards for other billing countries, use our international test cards.

We recommend using our test IDs when testing your integration and creating charges, instead of passing card information directly to the API. Using these test IDs in place of card numbers helps ensure your production integration is developed in a PCI compliant manner and is not going to handle card information directly. Each test ID is human-readable and represents card information that has been tokenized with our client-side libraries (e.g., Stripe Elements, Stripe.js).

Google API manager

Google API manager

Creating an API for a Reverse Geocoding With Google Map API And PHP!

After created an API key, when I trying to test it, I have received the next message:
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=AIzaSyDWpVDQyIieftj5WOKekltjoDx3z8rnowY

Result:

{
“error_message” : “This IP, site or mobile application is not authorized to use this API key. Request received from IP address 86.182.65.135, with empty referer”,
“results” : [],
“status” : “REQUEST_DENIED”
}

google api reverse enconding

Editiing/creating a Credential for a Browser API key

Accept requests from these HTTP referrers (websites) (Optional)
Use asterisks for wildcards. If you leave this blank, requests will be accepted from any referrer.
Be sure to add referrers before using this key in production.

*.camssay.com/*

*.camssay.co.uk/*

Once I click to save, I have received the next message:

Sorry, there’s a problem. If you have entered information, check it and try again.
Otherwise, the problem might clear up on its own, so check back later.

Google saving a credential

Using the console for developers by Google