slug Questions

15

Solved

I'm learning Django from Tango with Django but I keep getting this error when I type: python manage.py makemigrations rango python manage.py migrate This is the output: django.db.utils.Integrit...
Smother asked 31/3, 2015 at 16:38

28

Solved

I have a string that I want to use as a filename, so I want to remove all characters that wouldn't be allowed in filenames, using Python. I'd rather be strict than otherwise, so let's say I want t...
Earl asked 17/11, 2008 at 9:2

3

Solved

I changed the name of a React Native/Expo app and wanted to change the slug to go with it, but got the error "CombinedError: [GraphQL] Experience with name '@-----/newName' does not exist&quot...
Surcingle asked 20/9, 2022 at 19:41

7

I have everything in place to create slugs from titles, but there is one issue. My RegEx replaces spaces with hyphens. But when a user types "Hi     there" (multiple spaces) the slug ends...
Hutner asked 7/6, 2010 at 20:59

5

Solved

I want to make the slug field as read_only depending on the other field value like "lock_slug". Means There will be Two conditions. 1) When value of "lock_slug" is false then the slug field dire...
Ralfston asked 28/1, 2013 at 13:20

27

Solved

I'm working on an app in CodeIgniter, and I'm trying to make a field on a form dynamically generate the URL slug. What I'd like to do is remove the punctuation, convert it to lowercase, and replace...
Spermatophore asked 28/6, 2009 at 0:11

5

Solved

I need to get attribute from woocommerce product variation. $terms = get_post_meta($value['variation_id'], 'attribute_pa_color', true); This code is giving me an attribute slug instead of name....
Safeconduct asked 1/2, 2016 at 12:0

11

I am trying to create a SlugField in Django. I created this simple model: from django.db import models class Test(models.Model): q = models.CharField(max_length=30) s = models.SlugField() I the...
Brack asked 8/5, 2009 at 1:17

14

Solved

When I read Django code I often see in models what is called a "slug". I am not quite sure what this is, but I do know it has something to do with URLs. How and when is this slug-thing su...
Rossy asked 9/1, 2009 at 4:52

8

Solved

Why is it a bad idea to have a ID in the URL in terms of SEO? How does this URL http://example.com/user/1234 hurt SEO? Can someone give me a practical example where search engine rankings are wors...
Issue asked 26/5, 2009 at 13:29

12

Solved

I'd like to start using "SEO Friendly Urls" but the notion of generating and looking up large, unique text "ids" seems to be a significant performance challenge relative to simp...
Danaus asked 4/5, 2009 at 15:3

31

Solved

I want to have a function to create slugs from Unicode strings, e.g. gen_slug('Andrés Cortez') should return andres-cortez. How should I do that?
Nones asked 2/6, 2010 at 5:41

10

Solved

A slug on this context is a string that its safe to use as an identifier, on urls or css. For example, if you have this string: I'd like to eat at McRunchies! Its slug would be: i-d-like-to-eat...
Cunnilingus asked 19/5, 2010 at 10:48

13

Solved

I am trying to create a unique slug in Django so that I can access a post via a url like this: http://www.example.com/buy-a-new-bike_Boston-MA-02111_2 The relevant models: class ZipCode(models.Mo...
Accused asked 28/9, 2010 at 19:25

12

I am in search of the best way to "slugify" string what "slug" is, and my current solution is based on this recipe I have changed it a little bit to: s = 'String to slugify' slug = unicodedata.n...
Finsen asked 6/4, 2011 at 23:8

4

I have Article model and articles table in the database. Each article can be shown using Laravel's standard URI structure: www.example.com/articles/5 (where 5 is the article id). Each article has a...
Mansuetude asked 23/6, 2016 at 12:43

6

Solved

Looking at Str::slug for my frontend URL generation but just wondering how you guys go about implementing it with routes etc, for example, how would you guys go about changing http://www.example.co...
Kalimantan asked 1/7, 2013 at 9:7

8

Solved

class Foo(models.Model): title = models.CharField(max_length=20) slug = models.SlugField() Is there a built-in way to get the slug field to autopopulate based on the title? Perhaps in the Admin...
Stephi asked 26/9, 2008 at 19:40

7

After setting up the Sentry.io error tracking I get this error when I try to Generate Signed Apk: Java Compiler error: An organization slug is required (provide with --org) Click on this image a...
Bolin asked 19/11, 2018 at 7:14

6

I want to create a slug field stored in database. I searched and I found http://flask.pocoo.org/snippets/5/ but I'm having trouble integrating the code in my app. This is my modele.py: from uni...
Preconceive asked 14/5, 2014 at 14:26

4

Solved

I have a slugify method in an Twig Extension which i would like to use in some cases in a controller, f.e with redirects. Is there an easy way for this? How could i access functions from Twig Exten...
Nylanylghau asked 11/7, 2012 at 9:17

2

I am using a class to generate a string name profile to slug and next use an SQL command to tell me whats the unique value to use in insert command, the problem is the command isn't working properl...
Lutherlutheran asked 29/1, 2022 at 14:21

4

Solved

I'm trying to add slug so that the title of a post appears in the url but i get this message on console: You are trying to add a non-nullable field 'slug' to post without a default; we can't do tha...
Serotherapy asked 24/3, 2021 at 15:43

4

Solved

I want to convert any title e.g. of a blog entry to a user friendly url. I used rawurlencode() to do that but it gives me a lot of strange strings like %s. The algorithm should consider german char...
Hillinck asked 24/12, 2010 at 8:44

3

Solved

I have made eloquent-sluggable work on my app. Slugs are saved just fine. Buuuut... How do I use it to create a pretty url? If possible, I would like to use them in my url instead of ID numbers.
Wesleyanism asked 11/6, 2015 at 17:31

© 2022 - 2025 — McMap. All rights reserved.