waynelambert / portfolio Goto Github PK
View Code? Open in Web Editor NEWPortfolio site demonstrating skills with Python, Django, JavaScript, HTML, Sass, PostgreSQL, pytest, Docker, and Git.
Home Page: https://waynelambert.dev
Portfolio site demonstrating skills with Python, Django, JavaScript, HTML, Sass, PostgreSQL, pytest, Docker, and Git.
Home Page: https://waynelambert.dev
Due to the difference in orientation of the images, the aspect ratio cannot be maintained, therefore the quality of the image on the list pages is inadequate.
Each blog post needs two images:
The main image on the detail page. This has a landscape orientation.
An image for the pages:home
and blog:home
pages. This has a portrait orientation. I could call the field tile_image
.
This means I need a new image field in the Post
model of the database and to render this image to those pages instead.
There is a problem with the Sass compilation within the project which is preventing some CSS changes affecting the project.
Some fixes have been verified with the adjustments being represented correctly in Firefox Dev Tools.
At the moment, there is an issue with the pagination code whereby if a user searches for a keyword that returns exactly the number of results that the paginate_by
variable in the view is configured, the paginator object returns an additional number. This means that there is actually no objects on the additional paginator object which means when the user navigates to that page, it cannot find it and therefore the response is cannot use None as a query
.
The test case is searching for the keyword python
which returns 10 posts. The paginate_by
setting is 10, therefore all results should be displayed on one page and therefore there is no requirement for a paginator object to appear.
The skills pages are displaying the images too widely on mobile devices. The images are too wide for the iPad display meaning that the supplementary text looks narrow.
Some of the attributes are not displaying favourably on the dark theme. I will need to test and tweak to adjust for these.
Write a page reviewing the scraping
app.
Instead of having my notebooks as static content in GitHub, investigate using DataPane
I would like to implement an FAQ section within the main home page. The Tempo
theme has a good example of how this would work.
The countdown_numbers
app has a bug whereby if a user inputs an invalid calculation which meets the current validation conditions but does not parse by the eval function, an error is generated.
An example calculation to generate this bug is:
(100*5)-((10/5/)/2)
This is because of the /)
part of the string which forms an invalid calculation string.
I can either approach this by using some cleaning regex to remove the additional /
step, or redirect the user back to the page with an additional message within the messages framework. The former would involve trying to pre-empt the user's calculation so this doesn't appear to be the correct approach.
Current Conditions of Calculation
The form has a multiple form setup involving one for the Django User model and the other a Profile model connected using signals.
There are 3 problems with the form that need to be resolved.
The form does not post successfully
The form doesn't prepopulate for the fields which are from the profile form such as the author view radio buttons.
The form also doesn't pre-populate the image being used in the custom bootstrap file image box.
The footer section is very basic at the moment. I would like to implement something like the Tempo
theme, however the site is sparse on static pages at the moment, so will only use a fraction of the links that a deep footer affords.
The results could be scraped more quickly using Python's multiprocessing
module.
The app is also a good candidate to implement a progress bar.
Tutorial / Package: Celery Progress Bar with Django
The project has grown significantly since the early days.
It needs to be reorganised so that it's more maintainable going forward and in line with 12 factor app principles.
The following work is required to complete this:
Collate all Django apps into their own directory
Rename the ab_back_end
directory to aa_project
. It no longer needs to be identified as back end since the React front-end was removed from the project some time ago.
Splitting the settings.py
file into base.py
, dev.py
, and prod.py
files. These should all belong in their own directory within the project folder.
Rename ADMIN_ALIAS
environment variable to DJANGO_ADMIN_LOGIN_PATH
Reconfigure some of the settings to be more manageable.
An attempt to upgrade to Django 3.1
was undertaken on a local django-upgrade
branch. It installed with no issues, however there is an issue with the Django admin.
Hopefully this will be resolved with version 3.1.1
at the start of September.
For now, I will keep the master
branch on version 3.0.9
The following tasks should be undertaken to deploy the project:
Both the countdown_letters
and countdown_numbers
apps could be improved with a little bit of front-end work. They currently work fine, however I would like the render out the letters and numbers for the games using BootStrap cards embedded within table elements which would make them look like the actual letters and numbers on the game show.
Adjust the READMEs across the project
Check the GitHub pages for the visitor experience, etc
It appears as though the work has already been completed for Django Filter to be compatible with Django 3.0+ and Python 3.8, however needs to be published to PyPI. Issue in repo here.
Create an About
page.
Move any config that can be moved from .ini
, .cfg
, .bandit
, or .coveragerc
files into pyproject.toml`.
This may be increasingly possible over time as projects like PyTest and Coverage increase and improve their support for this.
The logging isn't functional in development at the moment, however it is on the production site. Need to investigate.
Additionally, I need to make a style in Sass for the log file contents for the 'destination_log_file` page.
Write a page reviewing the api
app.
Plug in the functionality for a downloadable CV.
Revamp the reading page from the last version of the site.
A list of items that have been resolved within the development of this project which makes for a good blog post.
select_related
and prefetch_related
to reduce the number of queries ran and to speed up your siteThe password reset feature needs to be investigated. It does not seem to recognise the address.
The following view does not have enough context to provide the template with the author view.
class UserPostListView(PostView):
""" Drives the list of posts written by a given author """
template_name = 'blog/user_posts.html'
paginate_by = 6
paginate_orphans = 3
def get_queryset(self):
user = get_object_or_404(get_user_model(), username=self.kwargs.get('username'))
return self.queryset.filter(author=user)
Browsing the posts view by author at the following URL results in the user not being diplayed.
http://localhost:8001/blog/user/bill-gates/posts
The current code displays the username that is logged in rather than the username associated with the posts. ๐คฆ๐ผโโ๏ธ
Adjust the About Me
page to be more engaging and add some images.
Write a page reviewing my data science notebooks.
Write a page reviewing the roulette
app.
Write a page reviewing the countdown_numbers
app.
Make the large buttons navigate between a next and previous post. For this, the detail page needs some context of neighbouring posts according to a sort order. A nice touch here would be to put the post title onto the buttons.
This could be taken out if it is considered surplus to requirements as it is a "nice to have"
The results of the table is fine, however the rendering of the table is not in the desired style. I would like to use the "table-striped" Bootstrap format which means working out how the template needs to be rendered with Django templating.
This issue is more of an aspirational item. I would like to integrate Wagtail into the project to give me more flexibility with posting non-standard data to the blog. At the moment, the functionality is slightly constrained by the limitations of the CK Editor.
Write a page reviewing the text_analysis
app.
Look into setting up some shields for the repo.
The images for the blog post app and more generally on the main blog and portfolio pages need some consideration.
The ideal would be that a user uploads the main blog post image through the create/update forms.
The main image could be used within the detail page.
Another image size is required for the site home page.
Another image size is required for the blog home page.
It may also be a nice touch to get a thumbnail sized image and add this to the search results and contents pages.
Create a series of custom error pages for the project.
400 - handler400 = BadRequestView.as_view()
403 - handler403 = SitePermissionDeniedView.as_view()
404 - handler404 = SitePageNotFoundView.as_view()
500 - handler500 = SiteErrorView.as_view()
Unit tests need to be written for the project's apps.
The contact form has been developed and posts successfully to the database, however it does not pass the is_valid check because the Captcha is required. This will need a new implementation of the captcha and involve looking at the Google documentation for the capture.
The form also fails the unit test for the same reason.
An RSS feed needs to be created for the blog.
The WYSIWYG editor for CK Editor has most of the icons greyed out and therefore unavailable. These are available within the the development environment and this issue only presents itself in production.
In development:
In production:
I suspect it is to do with one of the icons that I added since the last known working configuration.
Alternatively, the PostgreSQL database versions are close, however, not identical. In dev, the version is the Alpine version 11.8 from Docker Hub. In production, the version is 11.8 but the full PostgreSQL version as supplied by the Heroku add-on.
When entering the analyse
page, the text area is initiated with a tabbed indent already there. This means that the text area's placeholder text Enter text here
is not visible upon page load.
Write a page reviewing the countdown_letters
app.
Change the categories within the endpoints from displaying the IDs to the names.
A page that details the context, qualification and quantification of my skills.
Write a page reviewing the Blog app.
The profile page needs more work to make this look more presentable.
It would also be useful to add some resizing and compressing of profile avatar images using Pillow.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.