
@srish What's the programming language you're using?

seems to be python

Yes python

See is there any error?

You should do this:
result = users.create(ID.unique(), email=email, password=password, name=name)```

import ID
from appwrite SDK

Remove this code:
# Generate a unique user_id using the email address and a unique identifier
userid = re.sub(r'[^a-zA-Z0-9.-]', '', email) # Remove any special characters from the email
userid += '' + str(uuid.uuid4())
user_id = user_id[:36]

Here is the updated code

But still showing the same error

In the first image, remove your validation of user id. You are not supposed to validate user id yourself, appwrite does it on the backend and the returned error may be handled on the frontend.
FYI, ID.unique() returns the string unique()
and the backend generates an unique id internally

R u talking about user_id=ID.unique()?

This line👆

Btw, it's best to use 3 back ticks with multi-line code. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting

Your code should be someting like this:
@app.route('/signup', methods=['GET', 'POST'])
def signup():
error_message = None
if request.method == 'POST':
# Retrieve form data
email = request.form['email']
password = request.form['password']
name = request.form['name'] if 'name' in request.form else ''
try:
result = users.create(ID.unique(), email=email, password=password, name=name)
response = account.create_session(email, password)
session_data = response.json()
# Store the session data in the user's session
session['userId'] = session_data['userId']
session['email'] = email
session['token'] = session_data['$id']
# Redirect to the login page after successful signup
return redirect(url_for('login'))
except Exception as e:
error_message = str(e)
# Render the signup template
return render_template('signup.html', error_message=error_message)

Okie let me try this one


Now how to solve this?

You never called client.setEndpoint()

what is account.create_session(email, password)
?
did chatGPT generate this?? 😅

How to call client.setEndpoint()

this might be helpful: https://appwrite.io/docs/getting-started-for-server
We have lots of docs so make sure to go through them thoroughly

Getting started with the python SDK

I have set endpoint

But still it is showing error

please share the exact error and your updated code
Recommended threads
- Problem while creating new jwt token in ...
I have a component that creates new jwt every 14sec but it seems to not be working , also not sure if that is the best way to do it
- 🚨 CORS Issues with Web Platform Configu...
Hi! i am new to react and i am making a movie web app as a first project (learning while doing so i barely know stuff now) I've been struggling with CORS errors...
- Cannot deploy webapp created with React ...
Build works, deploy ends with "success", but when I visit the site, I get an "Internal server error". The issue can be reproed by creating a new blank app with ...
