teleren/devto huggingface dataset:
Exploring the Anatomy of a Django Project: A Guide to Default Files
Tags: django, tutorial, coding, python
Published: 2023-11-16 01:26:56

Django, a powerful web framework for Python, simplifies web development by providing a structured project layout. When you create a fresh Django project, several default files are generated, each serving a specific purpose in the application's architecture. In this blog post, we will take a closer look at these default files and explore their roles in a Django project.

![Project Structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wkb7rzfy245srlg08op2.png)

**1. __init__.py: The Initialization File**
The __init__.py file is essential for Python to recognize the directory as a package. While the file may be empty, its presence signifies that the folder should be treated as a Python package.

![__init__.py file ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4hv18mag2s3pnj3pccs.png)

**2. asgi.py and wsgi.py: Interface Files for Asynchronous and WSGI Servers**

- asgi.py is used for deploying Django projects with asynchronous server support. ASGI (Asynchronous Server Gateway Interface) enables handling asynchronous HTTP requests.

![Asgi.py file ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zbxt0asp9wxhkfi0ehfx.png)

- wsgi.py is the entry point for traditional WSGI (Web Server Gateway Interface) servers. It is used for deploying Django projects on servers like Apache or Nginx.

![Wsgi.py file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hqvd9cbq2evghlu9upmi.png)

**3. settings.py: Configuration Settings for the Project**
settings.py is a crucial file that contains configuration settings for the Django project. Here, you define database configurations, application settings, middleware, and much more. Customizing this file allows you to tailor your project to specific requirements.

![Settings.py file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w01j9sycdbsmabcje416.png)

**4. urls.py: URL Patterns for the Application**
In urls.py, you define the URL patterns for your project. This file maps URLs to views, allowing Django to route requests to the appropriate handlers. URL patterns help organize the structure of your web application.

![Urls.py file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/etwbqyrzuslvl7ed5m6o.png)

**5. manage.py: The Command-Line Utility**
manage.py is a command-line utility for interacting with your Django project. It allows you to perform various tasks such as running the development server, creating database tables, and applying migrations.

![manage.py file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j94hmhcajuc38rsog8i0.png)

At least once in your Django development Gerney go through the role of each default file in a Django project is crucial for effective development. While these files provide a solid foundation, Django's flexibility allows you to customize and extend your project as needed. As you delve deeper into Django development, mastering the intricacies of these default files will empower you to create robust and scalable web applications.

Happy Coding!
[Python] How to get full url from shortened url
Tags: python, tutorial, beginners, learning
Published: 2023-11-16 00:59:32


Sometimes when you scrape a website, you may have encountered the fact that the website returns shortened URLs to sources from other websites.


As in this case, for example, `https://upflix.pl/r/Qb64Ar` this link consists of a domain and some random characters. The way a shortened link works is that it redirects you to another page. Therefore, the `status_code` that our query returns is `302`

Sometimes it happens that we need a full URL to get that can do this with a few lines of Python code and the requests library.

```shell
pip install requests
```

We will use the `head` method to perform this function
This method is similar to `get` with the difference that it does not return any content, only headers.

```python
response = requests.head(short_url)
```

After executing the query, we can check the headers that were returned.
There is information here such as:
- date
- type of website content
- character encoding
- FULL LINK
and many other information you can see below.

```python
{'Date': 'Thu, 16 Nov 2023 00:43:13 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Connection': 'keep-alive', 'location': 'https://www.imdb.com/title/tt14060708/', 'vary': 'Origin', 'x-powered-by': 'PHP/7.3.33', 'x-frame-options': 'SAMEORIGIN', 'CF-Cache-Status': 'DYNAMIC', 'Report-To': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=bgvCMcMQg1ZkjanlgqzemKUHHthalhb%2FAT72Q58O8a22eFmkeb%2FyeeIMfKkGFwt8WmkMB6dv28F1G2CdH134Kilk%2BcdQNweIZ3O%2FN9KlQf1A2VF%2Bm3yYT89rvjU%3D"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains; preload', 'X-Content-Type-Options': 'nosniff', 'Server': 'cloudflare', 'CF-RAY': '826bb2ce597ebfda-WAW', 'alt-svc': 'h3=":443"; ma=86400'}
```

## Full code

```python
import requests
from typing import Optional 

def get_full_url(short_url: str) -> Optional[str]
    response = requests.head(short_url)
    if response.status_code == 302:
        headers = response.headers
        return headers["location"]

    return None 

```
Create the Best Linux shortcut to move your windows between workspaces
Published: 2023-11-16 00:35:17

What I love about linux and the gnome desktop, are all the great customization powerups available.

One of my main go-to's is to configure the keys

super+shift+left = move window to left monitor
super+shift+right = move window to right monitor
super+shift+down = move window to lower WORKSPACE
super+shift+up = move window to upper WORKSPACE

To do this, open settings->keyboard-shortcuts

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vzgu9ie7ey8evaj6b8l.png)

next, look for:
"move window to lower workspace"
"move window to upper workspace"
"move window to rightward monitor"
"move window to leftward monitor"

and set a shortcut key for each one.

Now moving your screens around will be much easier in Linux.

By the way, I am using PopOS 22.04
I love it!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/br345k9qkmunkp3e2d03.png)
The AI app development journey and how evals save you time
Published: 2023-11-16 00:35:13

The AI app development journey:
1. Start with a prototype and manually test
2. Get tired of manually testing
3. Evaluations enlightenment: add evaluations to your code
???
4. App is in production. Users rave about your app

[Read the full blog post here](https://braintrustdata.com/blog/journey)
How to compile your SASS code to CSS from the command line
Published: 2023-11-16 00:23:02

Hello there

In this tutorial, I'll share how to compile SCSS files to CSS using only the command line and no external compilers or task runners. Let's dive into it...

## <u>Table of content</u>

1. Compiling a single Sass file to CSS.
2. Compiling multiple Sass files to CSS.

**Note:**  This course requires you to have prior knowledge of HTML and at least intermediate knowledge as neither will be covered in this tutorial.

Before we begin you need to have Nodejs and npm installed on your local computer, if you don't have Nodejs installed, install them here: [](https://nodejs.org/en/download/current).

**PS:** NPM comes pre-installed with Nodejs so you don't need to install it separately.

## 1. Compiling a single Sass file to CSS.

![subheading](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0og5hzlw419jo9ykwt0a.png)

Open the terminal on Vs code, to initialize npm in your local folder run: 

`npm init -y`

This creates a package.json file that contains information about your project. 

Once NPM is initialized install Sass globally on your local machine by typing

`npm install -g sass`

Once you've installed Sass globally check the version by typing

`sass --version`

Next, create a sass file, input.scss, open the terminal
and run the following command

`"sass input.scss output.css`

This starts the compiler which outputs the compiled sass code from into output.css. To watch for changes to your code and compile on saving the file add the watch flag to the command like so:

`sass --watch input.scss output.css`

This creates a CSS file containing the compiled sass code.

## 2. Compiling multiple Sass files to CSS.

![subheading](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vmfme9p009uiany4pqh.png)

Suppose you're working on a large project that requires you to write a lot of style rules and writing all sass code in 1 file can be bulky you can split your code into multiple files and then compile them all at the same time. To do this create a folder named **sass** or **scss** in your project for storing all your sass files and then create a CSS folder where the compiled CSS code files will be stored. Then in your terminal run the following command 

`sass --watch scss:css/`

This starts the compiler which compiles all sass files in the scss folder and outputs the compiled code into the CSS folder.

Thanks for reading.

Adios!
I made a Pricing Page template with TailwindCSS and ShadcnUI 🔥
Tags: tailwindcss, react, opensource, nextjs
Published: 2023-11-16 00:10:54

Hey everyone! I noticed that there aren't a lot of free and open-source pricing pages with Tailwind, and none with Shadcn UI, so I made my own from scratch and wanted to share it with the community. You can copy-paste the code in the repo and have a fully functional pricing page in two clicks!


## Demo Gif
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cs8vpbq8iy9y0j9qdu6s.gif)

✅ Dark & Light Mode
✅ Monthly / Yearly Plan
✅ Yearly Plan savings automatically calculated and highlighted
✅ "Popular" tag (PRO Plan in the live preview)
✅ "Exclusive" tag (EXCLUSIVE Plan in the dark theme live preview)


## Customization
This template is fully customizable and responsive. You can easily add and delete plans, and fill them with the data you what. At the bottom of src/app/page.tsx (which is the only relevant file) you'll find the customization array:

```
const plans = [
    {
      title: "Basic",
      monthlyPrice: 10,
      yearlyPrice: 100,
      description: "Essential features you need to get started",
      features: ["Example Feature Number 1", "Example Feature Number 2", "Example Feature Number 3"],
      actionLabel: "Get Started",
    },
    {
      title: "Pro",
      monthlyPrice: 25,
      yearlyPrice: 250,
      description: "Perfect for owners of small & medium businessess",
      features: ["Example Feature Number 1", "Example Feature Number 2", "Example Feature Number 3"],
      actionLabel: "Get Started",
      popular: true,
    },
    {
      title: "Enterprise",
      price: "Custom",
      description: "Dedicated support and infrastructure to fit your needs",
      features: ["Example Feature Number 1", "Example Feature Number 2", "Example Feature Number 3", "Super Exclusive Feature"],
      actionLabel: "Contact Sales",
      exclusive: true,
    },
  ]
```


## Card variations
I also made two card variations. You can add them with `popular:true` or `exclusive:true` in the specific plan you want to highlight.


### Popular tag
 

The first one is the "popular" tag, that you can see in the PRO plan in the example. It adds the gradient outline to highlight the card.


### Exclusive tag


The second one is the exclusive tag, only available in dark mode. It's the shine effect in the EXCLUSIVE plan.


[Github Repo](https://github.com/m4nute/pricing-page-shadcn).
[Live Demo](https://pricing-page-shadcn.vercel.app/)

Follow me if you wanna see more of my work 😊. I'm currently looking for opportunities, feel free to contact me at mgud@proton.me

That's it!
How to Climb the Tech Company Ladder?
Tags: discuss
Published: 2023-11-16 00:00:00

---
published_at : 2023-11-16 00:00 +0000
---
What strategies and steps can aspiring tech professionals take to advance their careers and climb the ladder within tech companies? Share your insights and experiences.
<br>
Follow the DEVteam for more discussions and online camaraderie! {% embed https://dev.to/devteam %}
Where Does Willpower Come From?
Tags: discuss, codenewbie, beginner
Published: 2023-11-16 00:00:00

---
published_at : 2023-11-16 00:00 +0000
---
What is willpower? And where do you discover the motivation to persevere?
<br>
Follow the CodeNewbie Org and #codenewbie for more discussions and online camaraderie!
{% embed https://dev.to/codenewbieteam %}
about players making sense
Tags: gamedev, gamedesign, writing, writingtips
Published: 2023-12-20 12:58:16

---
title: about players making sense
published: true
date: 2023-11-16 00:00:00 UTC
tags: [ 'gamedev', 'gamedesign', 'writing', 'writingtips' ]
canonical_url: https://onwriting.games/daily/20231116-1050-about-players-making-sense/
---

narrative in all its forms is nothing but an ultra-effective strategy for **generating meaning** in our brains.

humans tend to group knowledge and remember through the connection of ideas, and nothing is better than narrative to aid this process.

those of us who have designed many games throughout our lives are hyper-aware of this.

Brian Upton managed to synthesize it better than anyone in his book Aesthetics of Play.

a game is **not merely the rules** , or in the case of stories, the events that happen, nor even the dynamics and argumentative arcs.

no, half of the game is the player's **interpretation of everything that is happening** : the process of meaning generation.

we have a great tool at our disposal if we can master semiotics.

exploration and iteration are the bases for finding unique things, but it is good to have a framework to **guide these explorations**.

next time you sit down to write a scene for your game, why not think about what the player knows at that moment and what they should know next,

then you can try exploring different paths to arrive at the same destination of meaning generation in their head.
Mine Verus on Android: Easy Guide to Smartphone Mining
Tags: cryptocurrency, crypto, mobile
Published: 2023-10-09 03:04:45

---
title: Mine Verus on Android: Easy Guide to Smartphone Mining
published: true
date: 2023-11-16 00:00:00 UTC
tags: Cryptocurrency,Crypto,Mobile
canonical_url: https://simeononsecurity.ch/other/mine-verus-on-android-guide/
---

Learn how to efficiently mine VerusCoin on your Android device using a step-by-step guide.

[https://simeononsecurity.ch/other/mine-verus-on-android-guide/](https://simeononsecurity.ch/other/mine-verus-on-android-guide/)
How to Delete a Table from a Database in Django
Tags: django, database, python, djangomodel
Published: 2023-11-15 23:56:24

Deleting a single table in Django 3 and above versions can be done efficiently with the following steps:

**1. Remove or Comment the Model Class:**
In the models.py file, simply remove or comment out the model class corresponding to the table you want to delete. Save the file.


![models image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4o237cmcn2sdyci199sy.png)


**2. Update admin.py, forms.py, and views.py:**
Similarly, in the admin.py, forms.py, and views.py files, remove or comment out the model class and all instances where it's being used.
ex..
- admin.py 
![admin instance example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bpc2c88ei2v43kvo6tj9.png)
- forms.py
![djngo forms example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8qgprhqw0fakyenx6wly.png)
- views.py
![django views example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/su70je6h5f2wzrfvls05.png)

**3. Run Migrations:**
After modifying the files, run the following commands in the terminal to create and apply migrations:

```
python manage.py makemigrations 
python manage.py migrate
```
By following this streamlined approach, you ensure that all instances of the model class are removed consistently across your project, minimizing the risk of errors and making the deletion process more efficient.

Happy coding!
Auto installer script for Fooocus Web UI on RunPod & Full Tutorial
Tags: tutorial, beginners, stablediffusion, ai
Published: 2023-11-15 23:35:09

If you want to use Fooocus on RunPod our 1 click auto installer working amazing

Download script > https://www.patreon.com/posts/fooocus-sd-web-1-92759045

Tutorial link > [Fooocus Stable Diffusion Web UI — Use SDXL Like You Are Using Midjourney — Easy To Use High Quality
](https://youtu.be/jHTkVm2mcfs)

{% embed https://youtu.be/jHTkVm2mcfs %}


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ge9ktdnol0mxicx1izq1.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26jio0svrrsp763pmlcd.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hs4pjmu5fye7274yl4qv.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jeogu6nqy7fki036j31d.png)
How to manage node versions across projects
Tags: node, webdev, nvm
Published: 2023-11-15 22:59:47

If you're currently utilizing Docker container projects, there's no need to worry about your existing Node version.  But that’s another different topic from this one that I’ll probably share with you in the future. For now, I'd like to share my story with using nvm across all my Node.js projects on my macOS system.

_Note: If you have a pre-existing Node.js version on your machine, it will remain accessible as the default version. This allows you to continue using and installing nvm._

1) Get nvm installed in your macOS terminal console

Option 1: ``` brew install nvm ```

Option 2: ``` curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash ```

Option 3: ``` wget -q0- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash```

2) Indicated nodejs version required in my project folder in a git-tracked .nvmrc file: 

```echo v18.14.1 > .nvmrc```
install it
``` npm install v18.14.1```

3) This does not take effect automatically on cd, the user must do it:
```nvm use```

Now you can see all the node versions you have installed with ```nvm list```

.nvmrc is documented at: https://github.com/creationix/nvm/tree/02997b0753f66c9790c6016ed022ed2072c22603#nvmrc
How to create a fade animation css with Qwik
Tags: qwik, webdev, programming, javascript
Published: 2023-11-15 22:35:24

**Fade animation** adds a distinctive touch to the user experience on your site. By taking advantage of CSS transitions and IntersectionObserver in **Qwik**, you can achieve a smooth effect when elements enter the viewport.

On my personal site, I implemented a fade effect using CSS transitions and the IntersectionObserver in Qwik. You can take a look at the animation at this [link](https://deluciapasquale.it/).

First, we define within the component the **signals** that will be useful for us to monitor the HTML element and its CSS properties. Inside the useVisibleTask$ hook, we insert the Observer.



    export default component$(() => {
      ...
      const sectionRef = useSignal<Element>();
      const sectionIsVisible = useSignal<boolean>(true);

      useVisibleTask$(() => {
        if (sectionRef.value) {
          const observer = new IntersectionObserver(([entry]) => {
            sectionIsVisible.value = entry.isIntersecting;
            if (sectionIsVisible.value) {
              observer.disconnect();
            }
          });

          observer.observe(sectionRef.value);
        }
      });
      ...
    });


The code within the `useVisibleTask$` hook is executed client-side only and creates an IntersectionObserver that updates the value of the `sectionIsVisible` signal. This signal will then be used to apply the animation.

In the HTML file, we reference the element we want to animate using the signal sectionRef. With `sectionIsVisible`, we update the CSS classes.

First, we define these two classes in the `global.css` file:

Without Tailwind:


    animation {
      opacity: 0;
      transition-property: opacity;
      transition-delay: 150ms;
      transition-duration: 700ms;
      transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
    }

    animation.isVisible {
      opacity: 1;
    }


With Tailwind:


    .animation {
      @apply opacity-0 transition-opacity ease-in duration-700 delay-150;
    }

    .animation.isVisible {
      @apply opacity-100;
    }


Now we can edit the HTML element to which we want to apply the transition:



    <section
      ref={sectionref}
      class={"animation " + sectionIsVisible.value && "isVisible"}
    >
      <h2>FADE IN</h2>
    </section>


This way, when the HTML element enters the viewport, it will do so through an animation.

Further explore the possibilities for advanced customization and create an engaging user experience.

The complete and slightly more complex code is available in this [repository](https://github.com/VarPDev/pako).
FirmaDni - Simplifying Your Digital Signing Experience
Published: 2023-11-15 21:18:33

[https://firmadni.com]

FirmaDni is an innovative application designed to streamline and simplify the digital signing process. With an intuitive interface and powerful features, this app is set to revolutionize the way we interact with important documents.

Key Features:

1. Secure and Reliable Signing:
With FirmaDni, rest assured that your digital signatures are completely secure and legally valid. We employ the latest encryption standards to ensure the integrity of your documents.

2. Intuitive Interface:
Our app is designed with user-friendliness in mind. Every step, from uploading the document to signing, has been simplified to ensure anyone can use it without complications.

3. Full Compatibility:
FirmaDni is compatible with a wide range of document formats, including PDF, Word, and more. This means you can sign contracts, agreements, and forms regardless of the file type.

4. Multiple Signatures:
Need multiple people to sign the same document? With FirmaDni, you can invite multiple signers and track the status of their signatures in real-time.

5. Instant Notifications:
Receive real-time notifications each time someone signs a document. This allows you to maintain full control over the signing process.

Key Benefits:

Time and Resource Savings: FirmaDni eliminates the need for prints, scans, and physical document submissions. Everything is done quickly and efficiently online.

Legal Guarantee: We comply with electronic signature regulations and standards, ensuring that your signed documents are legally valid.

Access from Anywhere: FirmaDni is available on both mobile devices and computers, allowing you to sign documents from anywhere in the world.

Conclusion:

Download FirmaDni today and discover a faster and more secure way to manage your important documents. Simplify your life and save time with our leading digital signing application. Don't wait any longer to experience the electronic signature revolution!
Useful GitHub tricks and tips - 2
Tags: webdev, github, programming, git
Published: 2023-11-15 20:55:36

{% youtube T-zihJdDUDs %}

Hey everyone! Quick GitHub hack coming your way. You know that moment when you're lost in your repository, desperately looking for a file? Well, grab your keyboards, and let me show you a game-changer.

**Just chill in your GitHub repo; panic is unnecessary. Now, hit that magical 'T' button on your keyboard. Boom! A wild search bar appears.**

**Now, type in the name of the elusive file you're hunting. GitHub becomes your personal detective, and there you have it – your file, found in the blink of an eye. 🕵️‍♂️**

Who needs a treasure map when you've got the **'T' key**?
### Happy coding! 🚀