Skip to main content

No project description provided

Project description

Sign-Me-Up

Sign-Me-Up is a Django REST framework -based user registration and management API.
It provides a seamless solution for handling user registration, authentication, profile management, and more.
With Sign-Me-Up, you can quickly integrate user management functionality into your Django projects, allowing you to focus on building other parts of your application.

Features

The Django project will be preconfigured with the following features:

  • User registration with email verification
  • Token-based authentication for user login
  • User profile management
  • Customizable password strength requirements
  • RESTful API endpoints for easy integration with frontend frameworks.

Installation

Navigate to the desired project directory.

Check if you have virtualenv installed globally:

virtualenv --version

If you see an error, you need to install virtualenv. You can install it using pip:

pip install virtualenv

Create a virtual environment:

virtualenv env

Activate the virtual environment:

# For Windows
venv\Scripts\activate

# For macOS and Linux
source venv/bin/activate

Install signmeup using pip

pip install signmeup

Start a project

signmeup startproject <project_name>

Structure of the created project:

<project_name>/
├── accounts/
│   ├── __init__.py
│   ├── admin.py
│   ├── apps.py
│   ├── middleware.py
│   ├── migrations/
│   │   └── __init__.py
│   ├── models.py
│   ├── serializers.py
│   ├── tests.py
│   └── views.py
├── <project_name>/
│   ├── __init__.py
│   ├── .env
│   ├── asgi.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
├── db.sqlite3
└── manage.py

Configuration

A .env file is added to the core of the project.
Configure the project by defining the following environment variables:

Email Variables

  • EMAIL_HOST: The hostname of the email server. Example: smtp.gmail.com
  • EMAIL_PORT: The port number of the email server. Example: 587
  • EMAIL_BACKEND: The email backend to use. Example: django.core.mail.backends.smtp.EmailBackend
  • EMAIL_HOST_USER: The username for authenticating with the email server. Example: your_email@example.com
  • EMAIL_HOST_PASSWORD: The password for authenticating with the email server.
  • EMAIL_USE_TLS: Set it to True to use TLS encryption for email communication.

Database Variables

  • NAME: The name of the PostgreSQL database.
  • USER: The username for authenticating with the PostgreSQL database.
  • PASSWORD: The password for authenticating with the PostgreSQL database.

General variables

  • DEBUG: Set it to True for development mode and False for production mode.
  • SECRET_KEY: The secret key used for cryptographic operations.

For Database and general variables, you wiil need to uncomment the following in `settings.py:

# Added by signmeup: Define the databases in the .env file at the same location as this settings.py file

#DATABASES = {
#     'default': {
#         'ENGINE': 'django.db.backends.postgresql',
#         'NAME': os.getenv('NAME'), 
#         'USER': os.getenv('USER'), 
#         'PASSWORD': os.getenv('PASSWORD'), 
#         'HOST': os.getenv('HOST'), 
#         'PORT': os.getenv('PORT'),
#     }
# }
# Added by signmeup: Define the secret_key in the .env file at the same location as this settings.py file

# SECRET_KEY = os.getenv('SECRET_KEY') 

# Added by signmeup: Define the debug in the .env file at the same location as this settings.py file

# DEBUG = os.getenv('DEBUG') 

API Endpoints

The following API endpoints are available:

  • User Registration: Register a new user.

    • Method: POST
    • URL: http://localhost:8000/accounts/register/
    • Fields: username, email, password
  • Verify Email: Verify the user's email address using the verification token received via email.

    • Method: GET
    • URL: http://localhost:8000/accounts/verify-email/
    • Requires authentication: No
  • User Login: Log in a user and obtain an authentication token.

    • Method: POST
    • URL: http://localhost:8000/accounts/login/
    • Fields: username, password
  • User Logout: Log out the authenticated user.

    • Method: POST
    • URL: http://localhost:8000/accounts/logout/
    • Requires authentication: Yes
  • Get User Profile: Get the profile information of the authenticated user.

    • Method: GET
    • URL: http://localhost:8000/accounts/profile/
    • Requires authentication: Yes
  • Update User Profile: Update the profile information of the authenticated user.

    • Method: POST
    • URL: http://localhost:8000/accounts/profile/
    • Requires authentication: Yes
  • Delete User: Delete the authenticated user's account.

    • Method: DELETE
    • URL: http://localhost:8000/accounts/delete/
    • Requires authentication: Yes

Testing API endpoints

To interact with the API endpoints for your newly created project, you can use tools like Postman to send HTTP requests to the API endpoints. Here's how you can use Postman:

  1. Install Postman on your machine from the Postman website.
  2. Launch Postman and create a new request.
  3. Set the request method (e.g., POST, GET) and URL for the desired API endpoint.
  4. Add any required headers or request parameters.
  5. Send the request and view the response.

Make sure to replace http://localhost:8000/ in the API URL with the appropriate base URL if running the API on a different host or port.

Contributing

Contributions are welcome! If you would like to contribute to Sign-Me-Up, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Implement your changes and ensure that the tests pass.
  4. Commit and push your changes to your forked repository.
  5. Open a pull request, and provide a detailed description of your changes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

signmeup-0.0.3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

signmeup-0.0.3-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file signmeup-0.0.3.tar.gz.

File metadata

  • Download URL: signmeup-0.0.3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for signmeup-0.0.3.tar.gz
Algorithm Hash digest
SHA256 54d7ee446f7cf943286262ffc6475bd85409e6878a34a7b7ec3eb5fe6a2e118c
MD5 425c514dcc58deb359b4ce5ed2d059b6
BLAKE2b-256 45ee2fd0e806380072a241efc7b426c3ffaf66464faa4809284928a3f8be0e9e

See more details on using hashes here.

File details

Details for the file signmeup-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: signmeup-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for signmeup-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b81a9b8c2b9754ae223ad5d20f030709fce54b57742db88ada3fa21bc9b2a926
MD5 5a14b8c0955bd63f69ab3a575f9c7c02
BLAKE2b-256 6dd9b926537658f3f82b7e2862a39bdb1ebdf70ca01a44bf6316f7525b2beb23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page