r/Web_Development • • Apr 28 '20

coding query Could someone tell me what my .htaccess file should contain?

8 Upvotes

Hi,

I have been investigating the solution for how to create a proper .htaccess file to clean the URL of my website, but I could not make it work.

Let's say my website is this: abcde.com and there is a button on the site that brings the user to a section and then the link changes to abcde.com/#section. I want it not to show the #section part. So what's the file in that case?

(my website is an index.html file)

Thanks for the answer in advance.


r/Web_Development • • Apr 25 '20

technical resource Website changes not showing after cache being cleared.

6 Upvotes

Hi! I have a website that is developed 100% in HTML and CSS.

My client requested changes so I made them and upload though Filezilla.

Now in some browsers, desktop and mobile (with cache cleared) the changes are not shown and in other are show, and I do not have idea why. Any ideas?


r/Web_Development • • Apr 25 '20

coding query AWS S3 Bucket Django 3.0 User Profile Image Upload Access ERROR

1 Upvotes

INTRO

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

- Switched on a central EU server that is more local to me. NOT worked I got the same error.

storage_backends.py

from django.conf import settings
from storages.backends.s3boto3 import S3Boto3Storage

class StaticStorage(S3Boto3Storage):
    location = settings.AWS_STATIC_LOCATION

class PublicMediaStorage(S3Boto3Storage):
    location = settings.AWS_PUBLIC_MEDIA_LOCATION
    file_overwrite = False

class PrivateMediaStorage(S3Boto3Storage):
    location = settings.AWS_PRIVATE_MEDIA_LOCATION
    default_acl = 'private'
    file_overwrite = False
    custom_domain = False

settings.py

AWS_ACCESS_KEY_ID = 'DSHUGASGHLASF678FSHAFH'
AWS_SECRET_ACCESS_KEY = 'uhsdgahsfgskajgjkafgjkdfjkgkjdfgfg'
AWS_STORAGE_BUCKET_NAME = 'MYSTORAGE289377923'
AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME

AWS_S3_OBJECT_PARAMETERS = {
    'CacheControl': 'max-age=86400',
}

AWS_STATIC_LOCATION = 'static'
STATICFILES_STORAGE = 'mysite.storage_backends.StaticStorage'
STATIC_URL = "https://%s/%s/" % (AWS_S3_CUSTOM_DOMAIN, AWS_STATIC_LOCATION)

AWS_PUBLIC_MEDIA_LOCATION = 'media/public'
DEFAULT_FILE_STORAGE = 'mysite.storage_backends.PublicMediaStorage'

AWS_PRIVATE_MEDIA_LOCATION = 'media/private'
PRIVATE_FILE_STORAGE = 'mysite.storage_backends.PrivateMediaStorage'

AWS_S3_HOST = "s3.eu-central-1.amazonaws.com"
S3_USE_SIGV4 = True
AWS_S3_REGION_NAME = "eu-central-1"

models.py

from django.db import models
from django.conf import settings
from django.contrib.auth.models import User

from mysite.storage_backends import PrivateMediaStorage


class Document(models.Model):
    uploaded_at = models.DateTimeField(auto_now_add=True)
    upload = models.FileField()


class PrivateDocument(models.Model):
    uploaded_at = models.DateTimeField(auto_now_add=True)
    upload = models.FileField(storage=PrivateMediaStorage())
    user = models.ForeignKey(User, related_name='documents')

views.py

from django.contrib.auth.decorators import login_required
from django.views.generic.edit import CreateView
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator

from .models import Document, PrivateDocument


class DocumentCreateView(CreateView):
    model = Document
    fields = ['upload', ]
    success_url = reverse_lazy('home')

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        documents = Document.objects.all()
        context['documents'] = documents
        return context


@method_decorator(login_required, name='dispatch')
class PrivateDocumentCreateView(CreateView):
    model = PrivateDocument
    fields = ['upload', ]
    success_url = reverse_lazy('profile')

    def form_valid(self, form):
        self.object = form.save(commit=False)
        self.object.user = self.request.user
        self.object.save()
        return super().form_valid(form)

ERROR

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>56fg67dfg56df7g67df</RequestId>
<HostId>
hsiugYIGYfhuieHF7weg68g678dsgds78g67dsg86sdg68ds7g68ds7yfsd8f8hd7
</HostId>
</Error>

Things That I have Tried So Far

AWS_S3_HOST = "s3.eu-central-1.amazonaws.com"
S3_USE_SIGV4 = True
AWS_S3_REGION_NAME = "eu-central-1"

r/Web_Development • • Apr 25 '20

Browser permissions for webcam access. What is possible?

5 Upvotes

I don't have much experience with web development. But for my paper, which I write, I would like to know if the following is possible:

  1. Is it possible to build a website so that it automatically takes a picture with the webcam when you visit it? (if the user has given permission for this site in advance to access the webcam, of course)
  2. Is it possible to program a browser addon / extension to have the permission to activate the webcam automatically (no recording) when you visit certain websites?

r/Web_Development • • Apr 24 '20

700+ FREE UI Icons in CSS, SVG, Figma & Adobe XD - CSS.GG v2.0

17 Upvotes

CSS.GG v2.0 is live now
700 UI Icons in Pure CSS, SVG & Figma

  • 200 New Icons
  • SVG Icons
  • SVG Sprite
  • Styled Components - ⚛ React JS
  • Local Styled Components
  • Figma Components
  • Adobe XD Components

Figma: https://css.gg/fig
Adobe XD: https://css.gg/xd
Website: https://css.gg
Repo: https://github.com/astrit/css.gg

This project is open source.


r/Web_Development • • Apr 25 '20

JavaScript API Project | Cats Pics Generator JavaScript Tutorial using fetch API (2020)

1 Upvotes

r/Web_Development • • Apr 23 '20

[FREE Photo Tool] Background remover for photos!

6 Upvotes

Hey, we made this free tool for everyone. Our algorithm is great for human photos at the moment. We are working on animals and products. We'd love to have your feedback.


r/Web_Development • • Apr 23 '20

Which is the more convenient way to get a domain with both a forum and a blog?

0 Upvotes

Hi everyone, I hope my question is relevant to this subreddit. My friends and I would like to start a very simple and unambitious project which requires a domain with both a forum (that we would like to be hidden, i.e. accessible only to the "staff") and a blog (normally accessible by anyone). I see that, for about 80 euros per year, we can get on bluehost an hosting with "illimited websites". Does this mean that we will be able to have both a blog and a forum without additional costs? None of us is a web developer, so we are a bit confused. We would like to use wordpress for the blog and bbpress for the forum.

Thanks a lot!


r/Web_Development • • Apr 22 '20

The web project guide...from spark to launch and beyond

3 Upvotes

This is some good reading, very good reading https://www.webprojectbook.com/, thanks @WebProjectGuide


r/Web_Development • • Apr 22 '20

JS Logic Practice

2 Upvotes

Anyone know of anywhere I can get some logic problems to try and practice with in js? Almost like word problems where I have to think through the logic and come up with the code to find the answer...? Is that a thing?

I'm new to js and am realizing that correct syntax doesn't matter if the logic is wrong so I want to make sure I'm practicing both and I'm having trouble making up things to test myself against.

Thanks!


r/Web_Development • • Apr 21 '20

Breakpoints

1 Upvotes

Can anyone give me a legitimate time or usecase where they've benefitted using breakpoints over logging they're way through a bug? I was asked recently in an interview about my debugging techniques and all I use is logs... They wern't amused.


r/Web_Development • • Apr 20 '20

I have used all my knowledge to improve loading speed of a content website. from 53 to 99. Here's all I did.

24 Upvotes

Hi,
I wrote detailed blogpost about all actions I did while I have been improving loading speed of client-side for PacoGames.com gaming website. The blogpost summarizes work on mobile website, however the same work was applied also for desktop web.

Starting page speed insight score 53 (mobile)
Ending page speed insight score 99 (mobile)

Main improvements:

- Reduction of loading speed
- reduction of TTFB

I used more tracking tools to prove the results.
Here's the blogpost: https://www.gamearter.com/blog/page-speed-optimization


r/Web_Development • • Apr 20 '20

technical resource Cloudprobes provides a simple way of monitoring websites and API endpoints ensuring that your services are reachable for your users at all times.

2 Upvotes

We have launched a new monitoring tool for websites and APIs which performs simultaneous checks from different geographic locations to assess your website's reachability and performance with maximized accuracy, plus I have included all classic monitoring specific features.

Currently, we are actively gathering feedback from beta testers for our iterative development process. We would appreciate your feedback.

Please sign up and give it a try, it’s free for the first 15 days, if you need to extend your trial or account limits please don't hesitate to get in touch with me.

https://www.cloudprobes.com


r/Web_Development • • Apr 20 '20

How to format a date in JavaScript just as simply as in PHP?

1 Upvotes

I've never understood why formatting a date takes 1 line of code in PHP and other languages yet it takes many lines in JavaScript.

At least that was the case last time I checked, is there some little known, new ES6 way of going from a variable myDate containing "Mon Apr 20 2020 14:45:34 GMT+0100 (British Summer Time)" to "2020-04-20" in just 1 or 2 lines of code?


r/Web_Development • • Apr 20 '20

I have created a PHP library that converts HTML to AMP HTML(Accelerated Mobile Pages)

1 Upvotes

I have created a PHP library that converts HTML content generated by WYSIWYG editors to AMP HTML(Accelerated Mobile Pages). I hope it is useful. I will appreciate any feedback.

https://github.com/magyarandras/amp-converter


r/Web_Development • • Apr 17 '20

I have created a compete dashboard for US COVID-19 cases tracking.

4 Upvotes

The complete Dashboard: https://www.yogeshchauhan.com/Projects/COVID-19/coronavirus-us-live-dashboard-by-yogesh-chauhan.php

I have created this website to display the data in as simplest format as possible and I have added many graphs to achieve that.

Today I came up with this idea of creating a DASHBOARD. It has pie charts with population and with cases that makes the picture very clear.

Also, 7 days and 30 days line charts and column charts shows what's the recovery speed and what's the spread speed.

At the end, it has most affected states and counties tables with the full table links.

Looking forward to your suggestions. Stay safe people!


r/Web_Development • • Apr 17 '20

ASPX Webforms site works on Desktop mode but 404s on Mobile

2 Upvotes

A user informed us that our website was returning a 404 error on her mobile phone upon investigation we found that if the website is viewed in a mobile browser it will return a 404 however if desktop mode is requested it will work. I am at a loss on how to fix this.


r/Web_Development • • Apr 16 '20

my website is shown on search engines when only search in English, not in arabic??

2 Upvotes

what html tags do i need to add or modify to help search engines find my website when i search for website name in arabic??


r/Web_Development • • Apr 14 '20

technical resource APIsFinder : Webapp to search and find open and publics API (my first application), what do you think ?

22 Upvotes

Hi everyone, I have developed a simple application that allows you to search and find the API you need for web development. Its name is APIsFinder (https://apisfinder.com) I know that this is nothing revolutionary, but it is my first personal application put into production. What do you think ? How can I improve it? I also created a PWA and an android application based on it (being validated in the play store). Any return is good to take! thank you !


r/Web_Development • • Apr 14 '20

Staying Fresh in One Language while learning another... (Rookie Question)

3 Upvotes

Looking for some good review resources like quizzes and challenges with html, CSS, and Java. I am in a few classes online and I am wanting to practice/review as I go. For example, I'm working through a class on Java Script right now but want to stay fresh on what i just learned in my HTML and CSS class. I would love something gamified that I can jump into for a few minutes on a break at work or sitting around at home.

Free would be great of course, but something under $5/month would be good to. Any recommendations for a rookie?

Thanks/!


r/Web_Development • • Apr 12 '20

Solution to page loading making you missclick things?

6 Upvotes

I've been searching for a solution for about 20min but I can't find the right words to Google this. Nothing seems to get me an answer.

What I'm talking about is when you enter a website and are about to click something and BAM, it gets pushed down by something else that just loaded up. Meanwhile you scroll down and BAM, something else just loaded and scrolled you up to Oblivion.

Sometimes it happens while you're reading something. And it gets worse while browsing on your smartphone. It's driving me nuts.

Not to mention cookie consent warnings that some people decide should be the size of the whole damn page, and if that weren't enough, adblock deactivation requests. "Oh! It seems like you're using adblock!" Oh! It seems like adblock was created because of people who abuse ads on their sites, without concern for user experience.

Seriously the web has GOT to change. I'm a beginner fullstack web developer and I'm definitely going to take these things into account.


r/Web_Development • • Apr 13 '20

Not Burned Out, But Not Satisfied

2 Upvotes

Hey all. I make a video on what happens when a coding job isn't quite as fun as it used to be. I'd love your feedback and thoughts. It's something that I think we all run into at times, and I still don't have a great solution to the problem. the video is here: The Coder's Conundrum.


r/Web_Development • • Apr 12 '20

I have created a timeline for historic data of COVID-19 cases, recoveries and deaths for each country. Looking forward to suggestions and feedback. Thank you and stay safe!

0 Upvotes

I have created this website to display the data in as simplest format as possible and I have added many graphs to achieve that.

Today I came up with this idea of creating a timeline to show the daily picture of what's going on. Rather than a table (which is already available on my website), I thought this will give people more understanding of the historic data.

You can go to the global view using this link: https://www.yogeshchauhan.com/Projects/COVID-19/coronavirus-global-live-tracker-by-yogesh-chauhan.php

and just click on "timeline".

USA direct link: https://www.yogeshchauhan.com/Projects/COVID-19/country-timeline.php?country_name=USA

Looking forward to your suggestions. Stay safe people!


r/Web_Development • • Apr 11 '20

Recommendations for a dynamic table sort animation framework/library

3 Upvotes

Hi all, I have a simple scenario I'm trying to implement that consists of a static webpage that displays a table. The table's data is pulled by jquery from a web service. Here is the main question, the rows in the table are ordered by a specific key, if the rows (or keys change) when new data is pulled down from the web service, I want to show an animation of the rows stacking up based on the new data (e.g. a row that was in the 2nd place moves up to the 1st place). So far this lib looks the closest to what I'm looking for, but I wonder if there are other tools or libraries that you know of and can share (mostly looking to do this with jQuery).